paranoid check that RNA string functions set the string, would have helped solve keymap search bug.

disabled in release mode.
This commit is contained in:
Campbell Barton
2011-09-02 10:43:51 +00:00
parent 7a496bfbcf
commit 15afd240e0

View File

@@ -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;
}