From: Wez Furlong Date: Thu, 17 Apr 2003 03:38:20 +0000 (+0000) Subject: Nicer error message when an invalid function name is specified. X-Git-Tag: RELEASE_0_6~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=826583dc91b0089422aa1ac3ef75c71fdb788099;p=php Nicer error message when an invalid function name is specified. --- diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index a6249c5dc8..3dd5211f5f 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -106,6 +106,7 @@ static void php_sqlite_function_callback(sqlite_func *func, int argc, const char zval ***zargs; zval funcname; int i, res; + char *callable = NULL, *errbuf=NULL; /* sanity check the args */ if (argc == 0) { @@ -115,10 +116,14 @@ static void php_sqlite_function_callback(sqlite_func *func, int argc, const char ZVAL_STRING(&funcname, (char*)argv[0], 0); - if (!zend_is_callable(&funcname, 0, NULL)) { - sqlite_set_result_error(func, "function is not callable", -1); + if (!zend_is_callable(&funcname, 0, &callable)) { + spprintf(&errbuf, 0, "function `%s' is not callable", callable); + sqlite_set_result_error(func, errbuf, -1); + efree(errbuf); + efree(callable); return; } + efree(callable); if (argc > 1) { zargs = (zval ***)emalloc((argc - 1) * sizeof(zval **));