]> git.sesse.net Git - xml-template/commitdiff
Fix is_associative_array() in php5-swig.
authorsgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:03:46 +0000 (23:03 +0200)
committersgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:03:46 +0000 (23:03 +0200)
php5-swig/xml-template.swig

index 5a560cee6883bf4bce903964fe653ee2755a71c5..d395ac20a72cc097ed7335b8dde68b7f6af1776a 100644 (file)
@@ -10,9 +10,7 @@ bool is_associative_array(HashTable *ht)
                return true;
        }
        for (unsigned i = 0; i < ht->nNumOfElements; ++i) {
-               char buf[32];
-               sprintf(buf, "%u", i);
-               if (!zend_hash_exists(ht, buf, strlen(buf))) {
+               if (!zend_hash_index_exists(ht, i)) {
                        return true;
                }
        }