[Bf-blender-cvs] [3d3531acb02] blender2.8: Fix unreported: Undo of texts pasted in the Text Editor misses one character.
mano-wii
noreply at git.blender.org
Wed Sep 19 04:12:10 CEST 2018
Commit: 3d3531acb026b6920898e6da5296204a7a4c6ca5
Author: mano-wii
Date: Tue Sep 18 23:11:59 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB3d3531acb026b6920898e6da5296204a7a4c6ca5
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'.
===================================================================
M source/blender/blenkernel/intern/text.c
===================================================================
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index f876592c0a8..7a9586175c6 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -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);
More information about the Bf-blender-cvs
mailing list