Fix unreported: Undo of texts pasted in the Text Editor misses one character.
Caused by commit rB28c34ae7e2d6 Unlike `strncpy`, `BLI_strncpy` ensures the last character is '\0'.
This commit is contained in:
parent
4597589503
commit
3d3531acb0
|
@ -1702,7 +1702,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 */
|
||||
BLI_strncpy(utxt->buf + utxt->pos, buf, length);
|
||||
memcpy(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