]> git.sesse.net Git - xml-template/commitdiff
Fix a segfaulting bug in the PHP5 SWIG version; we would get confused when PHP had...
authorsgunderson@bigfoot.com <>
Thu, 3 Nov 2011 21:11:34 +0000 (22:11 +0100)
committersgunderson@bigfoot.com <>
Thu, 3 Nov 2011 21:11:34 +0000 (22:11 +0100)
php5-swig/xml-template.swig

index 5e4e13337c522f87744606f91c5e1682d0e624d4..458296ef994e6d782a6f854854d57c921816298d 100644 (file)
@@ -72,6 +72,16 @@ Directive* convert_php_objects_to_directive(zval *obj)
                char *str = Z_STRVAL_P(obj);
                return new Replace(str);
        }
+       case IS_LONG: {
+               char str[256];
+               snprintf(str, sizeof(str), "%ld", Z_LVAL_P(obj));
+               return new Replace(str);
+       }
+       case IS_DOUBLE: {
+               char str[256];
+               snprintf(str, sizeof(str), "%f", Z_DVAL_P(obj));
+               return new Replace(str);
+       }
        case IS_RESOURCE: {
                XmlDocPtrWrapper *doc;
                if (SWIG_ConvertPtr(obj, (void **)&doc, SWIGTYPE_p_XmlDocPtrWrapper, 0) < 0 || doc == NULL) {