[Bf-blender-cvs] [39f7c8256d5] master: Fix unreported: Undo of texts pasted in the Text Editor misses one character.

mano-wii noreply at git.blender.org
Wed Sep 19 05:19:47 CEST 2018


Commit: 39f7c8256d5812289010e2a4369ff3cc267ef55f
Author: mano-wii
Date:   Tue Sep 18 23:11:59 2018 -0300
Branches: master
https://developer.blender.org/rB39f7c8256d5812289010e2a4369ff3cc267ef55f

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 76df163ee3a..fdc26fccda3 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -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);



More information about the Bf-blender-cvs mailing list