cvs: php4 /main main.c

From: Date: Sun, 23 Jun 2002 00:57:01 +0000
Subject: cvs: php4 /main main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12460@lists.php.net to get a copy of this message
helly Sat Jun 22 20:57:01 2002 EDT Modified files: /php4/main main.c Log: -unlimited php_printf Index: php4/main/main.c diff -u php4/main/main.c:1.459 php4/main/main.c:1.460 --- php4/main/main.c:1.459 Tue Jun 18 20:18:40 2002 +++ php4/main/main.c Sat Jun 22 20:57:01 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.459 2002/06/19 00:18:40 sniper Exp $ */ +/* $Id: main.c,v 1.460 2002/06/23 00:57:01 helly Exp $ */ /* {{{ includes */ @@ -362,16 +362,19 @@ { va_list args; int ret; - char buffer[PRINTF_BUFFER_SIZE]; + char *buffer; int size; TSRMLS_FETCH(); va_start(args, format); - size = vsnprintf(buffer, sizeof(buffer), format, args); - if(size > sizeof(buffer) - 1) { - size = sizeof(buffer) - 1; + size = vspprintf(&buffer, 0, format, args); + if (buffer) { + ret = PHPWRITE(buffer, size); + efree(buffer); + } else { + php_error(E_ERROR, "Out of memory"); + ret = 0; } - ret = PHPWRITE(buffer, size); va_end(args); return ret;

« previous php.cvs (#12460) next »