]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/libpy.c
Work around a bug in the Carbon headers
[wxWidgets.git] / wxPython / src / libpy.c
index 450467bd13c2bca64a8092bc7a8e16b21e64f487..aba06557686f63289620fb26ff3e322c1545a181 100644 (file)
@@ -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'))
@@ -402,6 +402,7 @@ SWIGSTATICRUNTIME(char *)
 SWIG_GetPtrObj(PyObject *obj, void **ptr, char *type) {
   PyObject *sobj = obj;
   char     *str;
+
   if (!PyString_Check(obj)) {
       if (!PyInstance_Check(obj) || !(sobj = PyObject_GetAttrString(obj,"this")))
           return "";
@@ -409,6 +410,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);
 }