From 15afd240e04ef3f220b6133cc920d964dbcfcf85 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Sep 2011 10:43:51 +0000 Subject: [PATCH] paranoid check that RNA string functions set the string, would have helped solve keymap search bug. disabled in release mode. --- source/blender/makesrna/intern/rna_access.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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; }