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:
@@ -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 */
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user