Browse Source

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.
experimental/new_apache_hooks
Sascha Schumann 24 years ago
parent
commit
ee477dbc56
  1. 5
      ext/interbase/interbase.c
  2. 4
      sapi/aolserver/aolserver.c

5
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));
}

4
sapi/aolserver/aolserver.c

@ -310,9 +310,9 @@ php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
char *value = Ns_SetValue(NSG(conn->headers), i);
char *p;
char c;
int buf_len;
buf_len = snprintf(buf, NS_BUF_SIZE, "HTTP_%s", key);
snprintf(buf, NS_BUF_SIZE, "HTTP_%s", key);
for(p = buf + 5; (c = *p); p++) {
c = toupper(c);
if(c < 'A' || c > 'Z') {

Loading…
Cancel
Save