summaryrefslogtreecommitdiff
path: root/ext/interbase/interbase.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-06-26 07:54:50 +0000
committerSascha Schumann <sas@php.net>2002-06-26 07:54:50 +0000
commitee477dbc56997b5233e5d69db77e710de5821358 (patch)
treeae7b202a4c0034a7fe272d9d42bdedffb59f77fa /ext/interbase/interbase.c
parentf57306cdd961ae630fb17903cc5b960cf2628102 (diff)
downloadphp-git-ee477dbc56997b5233e5d69db77e710de5821358.tar.gz
Fix code which makes wrong assumptions about the return value of snprintf.
The AOLserver module did not use the return value, so simply drop it.
Diffstat (limited to 'ext/interbase/interbase.c')
-rw-r--r--ext/interbase/interbase.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index ff951fe80d..8e4c9a3e51 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -285,13 +285,12 @@ static void _php_ibase_error(void)
static void _php_ibase_module_error(char *msg, ...)
{
va_list ap;
- int len;
TSRMLS_FETCH();
va_start(ap, msg);
- len = vsnprintf(IBG(errmsg), MAX_ERRMSG - 1, msg, ap);
+ /* vsnprintf NUL terminates the buf and writes at most n-1 chars+NUL */
+ vsnprintf(IBG(errmsg), MAX_ERRMSG, msg, ap);
va_end(ap);
- IBG(errmsg[len]) = '\0';
php_error(E_WARNING, "InterBase module: %s", IBG(errmsg));
}