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:
Germano Cavalcante 2018-09-18 23:11:59 -03:00
parent 4597589503
commit 3d3531acb0
1 changed files with 1 additions and 1 deletions

View File

@ -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);