summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-04-17 03:38:20 +0000
committerWez Furlong <wez@php.net>2003-04-17 03:38:20 +0000
commit826583dc91b0089422aa1ac3ef75c71fdb788099 (patch)
tree45b5160b222749657f3f9569d95dd9b8d9ad7d13 /ext/sqlite/sqlite.c
parentf7dbd9d909fc496cf632d5ae77023336431f683c (diff)
downloadphp-git-826583dc91b0089422aa1ac3ef75c71fdb788099.tar.gz
Nicer error message when an invalid function name is specified.
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c9
1 files changed, 7 insertions, 2 deletions
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 **));