X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqres.c;h=9b35f21011bde83dce3db70fb7cfec92c3597897;hp=eaaac6927dc96418e4708fac4413c2e7a2a791aa;hb=7acdd4b540f114ac8e8103df42633d5f741fb210;hpb=420e6ed4b6b95cf25985aed5dc6ddec06e823e41 diff --git a/src/php_pqres.c b/src/php_pqres.c index eaaac69..9b35f21 100644 --- a/src/php_pqres.c +++ b/src/php_pqres.c @@ -98,10 +98,13 @@ zval *php_pqres_typed_zval(php_pqres_t *res, char *val, size_t len, Oid typ TSRM MAKE_STD_ZVAL(zv); if (SUCCESS == zend_hash_index_find(&res->converters, typ, (void *) &zconv)) { - zval *tmp = NULL; + zval *ztype, *tmp = NULL; + MAKE_STD_ZVAL(ztype); + ZVAL_LONG(ztype, typ); ZVAL_STRINGL(zv, val, len, 1); - zend_call_method_with_1_params(zconv, NULL, NULL, "convertfromstring", &tmp, zv); + zend_call_method_with_2_params(zconv, NULL, NULL, "convertfromstring", &tmp, zv, ztype); + zval_ptr_dtor(&ztype); if (tmp) { zval_ptr_dtor(&zv);