X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9416aa89ca06d0fb20b1002e026d2c7ac7aa6a17..6c41903ced78c0b4115785aa80a934833abbc1ef:/wxPython/src/libpy.c?ds=sidebyside diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 450467bd13..1116e677df 100644 --- a/wxPython/src/libpy.c +++ b/wxPython/src/libpy.c @@ -317,11 +317,11 @@ SWIG_GetPtr(char *c, void **ptr, char *t) if (*c != '_') { *ptr = (void *) 0; if (strcmp(c,"NULL") == 0) return (char *) 0; - else c; + else return c; } c++; /* Extract hex value from pointer */ - while (d = *c) { + while ((d = *c) != 0) { if ((d >= '0') && (d <= '9')) p = (p << 4) + (d - '0'); else if ((d >= 'a') && (d <= 'f')) @@ -409,6 +409,8 @@ SWIG_GetPtrObj(PyObject *obj, void **ptr, char *type) { Py_DECREF(sobj); } str = PyString_AsString(sobj); + if (str == NULL) + return ""; return SWIG_GetPtr(str,ptr,type); }