Cleanup: Use BLI_strncpy
It has behavior which we expect, and silences strict compiler warning.
This commit is contained in:
parent
4d339f56fe
commit
28c34ae7e2
Notes:
blender-bot
2023-02-14 00:29:15 +01:00
Referenced by commit39f7c8256d
, Fix unreported: Undo of texts pasted in the Text Editor misses one character. Referenced by commit3d3531acb0
, Fix unreported: Undo of texts pasted in the Text Editor misses one character.
|
@ -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");
|
||||
strncpy(documentation, docs, len);
|
||||
BLI_strncpy(documentation, docs, len);
|
||||
documentation[len++] = '\n';
|
||||
}
|
||||
else {
|
||||
documentation = MEM_mallocN(len + 1, "Documentation");
|
||||
strncpy(documentation, docs, len);
|
||||
BLI_strncpy(documentation, docs, len);
|
||||
}
|
||||
documentation[len] = '\0';
|
||||
}
|
||||
|
|
|
@ -1705,7 +1705,7 @@ static void txt_undo_add_blockop(Text *text, TextUndoBuf *utxt, int op, const ch
|
|||
/* 4 bytes */
|
||||
txt_undo_store_uint32(utxt->buf, &utxt->pos, length);
|
||||
/* 'length' bytes */
|
||||
strncpy(utxt->buf + utxt->pos, buf, length);
|
||||
BLI_strncpy(utxt->buf + utxt->pos, buf, length);
|
||||
utxt->pos += length;
|
||||
/* 4 bytes */
|
||||
txt_undo_store_uint32(utxt->buf, &utxt->pos, length);
|
||||
|
|
Loading…
Reference in New Issue