diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-02 14:43:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-02 14:43:51 +0400 |
commit | 15afd240e04ef3f220b6133cc920d964dbcfcf85 (patch) | |
tree | f91b44a9669ba015360eaf0d80dddc0bc6436426 | |
parent | 7a496bfbcf3c5a25d4101cf427ca980327ed3e8a (diff) |
paranoid check that RNA string functions set the string, would have helped solve keymap search bug.
disabled in release mode.
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 9 |
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; } |