Fix possible misuse of BLI_strncpy
.
Same issue as rB39f7c8256d58.
This commit is contained in:
parent
340527cd37
commit
238a270d8f
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user