Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-02 14:43:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-02 14:43:51 +0400
commit15afd240e04ef3f220b6133cc920d964dbcfcf85 (patch)
treef91b44a9669ba015360eaf0d80dddc0bc6436426 /source/blender/makesrna/intern/rna_access.c
parent7a496bfbcf3c5a25d4101cf427ca980327ed3e8a (diff)
paranoid check that RNA string functions set the string, would have helped solve keymap search bug.
disabled in release mode.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 0d4e31cdaf2..ad79771416d 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2216,8 +2216,17 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi
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;
}