Fix possible misuse of `BLI_strncpy`.

Same issue as rB39f7c8256d58.
This commit is contained in:
Germano Cavalcante 2018-09-19 09:04:55 -03:00
parent 340527cd37
commit 238a270d8f
1 changed files with 2 additions and 2 deletions

View File

@ -246,12 +246,12 @@ void texttool_docs_show(const char *docs)
/* Ensure documentation ends with a '\n' */
if (docs[len - 1] != '\n') {
documentation = MEM_mallocN(len + 2, "Documentation");
BLI_strncpy(documentation, docs, len);
memcpy(documentation, docs, len);
documentation[len++] = '\n';
}
else {
documentation = MEM_mallocN(len + 1, "Documentation");
BLI_strncpy(documentation, docs, len);
memcpy(documentation, docs, len);
}
documentation[len] = '\0';
}