[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39870] trunk/blender/source/blender/ makesrna/intern/rna_access.c: paranoid check that RNA string functions set the string, would have helped solve keymap search bug.
Campbell Barton
ideasman42 at gmail.com
Fri Sep 2 12:43:51 CEST 2011
Revision: 39870
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39870
Author: campbellbarton
Date: 2011-09-02 10:43:51 +0000 (Fri, 02 Sep 2011)
Log Message:
-----------
paranoid check that RNA string functions set the string, would have helped solve keymap search bug.
disabled in release mode.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_access.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c 2011-09-02 10:43:16 UTC (rev 39869)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c 2011-09-02 10:43:51 UTC (rev 39870)
@@ -2216,8 +2216,17 @@
else
buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+#ifndef NDEBUG
+ /* safety check to ensure the string is actually set */
+ buf[length]= 255;
+#endif
+
RNA_property_string_get(ptr, prop, buf);
+#ifndef NDEBUG
+ BLI_assert(buf[length] == '\0');
+#endif
+
return buf;
}
More information about the Bf-blender-cvs
mailing list