[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43475] trunk/blender/source/blender/ blenkernel/intern/text.c: fix [#29914] paste text into blender causes crash

Sv. Lockal lockalsash at gmail.com
Tue Jan 17 20:03:22 CET 2012


Revision: 43475
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43475
Author:   lockal
Date:     2012-01-17 19:03:18 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
fix [#29914] paste text into blender causes crash

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/text.c

Modified: trunk/blender/source/blender/blenkernel/intern/text.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/text.c	2012-01-17 18:47:02 UTC (rev 43474)
+++ trunk/blender/source/blender/blenkernel/intern/text.c	2012-01-17 19:03:18 UTC (rev 43475)
@@ -225,7 +225,7 @@
 	int length = strlen(*str);
 
 	while ((*str)[i]) {
-		if((bad_char= BLI_utf8_invalid_byte(*str+i, length)) == -1)
+		if((bad_char= BLI_utf8_invalid_byte(*str+i, length-i)) == -1)
 			break;
 
 		added++;
@@ -238,7 +238,7 @@
 		i= 0;
 		
 		while ((*str)[i]) {
-			if((bad_char= BLI_utf8_invalid_byte((*str)+i, length)) == -1) {
+			if((bad_char= BLI_utf8_invalid_byte((*str)+i, length-i)) == -1) {
 				memcpy(newstr+mi, (*str)+i, length - i + 1);
 				break;
 			}



More information about the Bf-blender-cvs mailing list