bpy.props.StringProperty()'s maxlen arg was off by 1 since it included the null terminator for C strings.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user