Bugfixing #20663

From: Date: Sat, 30 Nov 2002 18:42:55 +0000
Subject: Bugfixing #20663
Groups: php.dev 
Request: Send a blank email to php-dev+get-91963@lists.php.net to get a copy of this message
Following patch allows longer error messages within Zend. marcus cvs -z3 -q diff zend.c (in directory S:\php4-HEAD\Zend) Index: zend.c =================================================================== RCS file: /repository/ZendEngine2/zend.c,v retrieving revision 1.193 diff -u -r1.193 zend.c
--- zend.c      30 Nov 2002 11:20:25 -0000      1.193
+++ zend.c      30 Nov 2002 16:55:20 -0000
@@ -703,8 +703,6 @@ } -#define ZEND_ERROR_BUFFER_SIZE 1024 - ZEND_API void zend_error(int type, const char *format, ...) {
        va_list args;
@@ -775,18 +773,7 @@
                        ALLOC_INIT_ZVAL(z_error_filename);
                        ALLOC_INIT_ZVAL(z_error_lineno);
                        ALLOC_INIT_ZVAL(z_context);
-                       z_error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
- -#ifdef HAVE_VSNPRINTF
-                       z_error_message->value.str.len = vsnprintf(z_error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
-                       if (z_error_message->value.str.len > ZEND_ERROR_BUFFER_SIZE-1) {
-                               z_error_message->value.str.len = ZEND_ERROR_BUFFER_SIZE-1;
-                       }
-#else
-                       strncpy(z_error_message->value.str.val, format, ZEND_ERROR_BUFFER_SIZE);
-                       /* This is risky... */
-                       /* z_error_message->value.str.len = vsprintf(z_error_message->value.str.val, format, args); */
-#endif
+                       z_error_message->value.str.len = vspprintf(&z_error_message->value.str.val, 0, format, args);
                        z_error_message->type = IS_STRING;
                        z_error_type->value.lval = type;


« previous php.dev (#91963) next »