diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-04-05 03:12:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-04-05 03:12:20 +0400 |
commit | 8fdfd4cc4c6b74418bfd28720e2fe027c76a1aeb (patch) | |
tree | bc1ae4de5bae672788b388f8df16bdb45e6c85bf /source/blender/python | |
parent | c3905009c4379a12475d108c4aebd3b81e6914b3 (diff) |
PyAPI - setting a buttons string value crashed. suspect this is a 64bit problem since replacing the string length of int, with Py_ssize_t or long prevented the crash. worked around the problem by removing the PyString_AsStringAndSize command.
wizard_curve2tree - removing id properties didnt work. exit button used a callback it didnt need to.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/Draw.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index 76e33a1bcb7..8d66068d581 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -532,10 +532,8 @@ static int Button_setattr( PyObject * self, char *name, PyObject * v ) return 0; } else if( but->type == BSTRING_TYPE && PyString_Check(v) ) { - char *newstr; - unsigned int newlen; - - PyString_AsStringAndSize( v, &newstr, (int *)&newlen ); + char *newstr = PyString_AsString(v); + int newlen = strlen(newstr); if (newlen+1> UI_MAX_DRAW_STR) return EXPP_ReturnIntError( PyExc_ValueError, "Error: button string length exceeded max limit (399 chars)."); |