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-06 11:08:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-06 11:08:20 +0400
commita41f45946f8bf7b58e2b6bc048bfa30015e4ba2f (patch)
tree3aa6be792f5e7673eda01b1b665762240db05a3f
parentfa32395b33f084d5c6c9d8026fd7d53335c9b41a (diff)
fix for error in strinc.c's BLI_strescape
-rw-r--r--source/blender/blenlib/intern/string.c4
-rw-r--r--source/blender/makesrna/intern/rna_access.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index c4ed44f0cdb..ae5fa40f3b9 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -129,7 +129,7 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen)
while(len < maxlen) {
switch(*src) {
case '\0':
- break;
+ goto escape_finish;
case '\\':
case '"':
@@ -154,6 +154,8 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen)
len++;
}
+escape_finish:
+
*dst= '\0';
return len;
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 936f2e5e40c..e7d0c5cdec2 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4407,7 +4407,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string");
buf_esc= MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc");
RNA_property_string_get(ptr, prop, buf);
- BLI_strescape(buf_esc, buf, length*2);
+ BLI_strescape(buf_esc, buf, length*2+1);
MEM_freeN(buf);
BLI_dynstr_appendf(dynstr, "\"%s\"", buf_esc);
MEM_freeN(buf_esc);