diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-25 01:28:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-25 01:28:33 +0400 |
commit | bfb9ef7ee9692326f0b9fdc55bb9f669010b275f (patch) | |
tree | 78f58326511317a068255d96ace452307efbde81 /source/blender/python | |
parent | 49db2d18b2ec4e465aa28653a7aed5d26f66c1db (diff) |
bpy.props.StringProperty()'s maxlen arg was off by 1 since it included the null terminator for C strings.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 3d7c0b133db..c278ad56ab9 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -586,7 +586,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) } prop= RNA_def_property(srna, id, PROP_STRING, subtype); - if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen); + if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen + 1); /* +1 since it includes null terminator */ if(def) RNA_def_property_string_default(prop, def); RNA_def_property_ui_text(prop, name, description); |