cvs: php4 /ext/sablot sablot.c

From: Date: Wed, 17 Jan 2001 14:14:22 +0000
Subject: cvs: php4 /ext/sablot sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3666@lists.php.net to get a copy of this message
sterling Wed Jan 17 06:14:22 2001 EDT Modified files: /php4/ext/sablot sablot.c Log: Fix (well it works) the error display with sablotron. Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.30 php4/ext/sablot/sablot.c:1.31 --- php4/ext/sablot/sablot.c:1.30 Wed Jan 17 03:43:17 2001 +++ php4/ext/sablot/sablot.c Wed Jan 17 06:14:22 2001 @@ -1394,27 +1394,16 @@ static void _php_sablot_standard_error(php_sablot_error *errors, php_sablot_error errors_start, int code, int level) { - int len = 0, - pos = 0; char *errstr = NULL; SABLOTLS_FETCH(); errors = errors_start.next; while (errors) { - len = pos + strlen(errors->key) + sizeof(": ") + strlen(errors->value) + sizeof("\n"); - - /** - * Could be a problem, I just hate looping through strings - * more than I have to ;-) - */ - if (pos) - errstr = erealloc(errstr, len); - else - errstr = emalloc(len+1); - - sprintf(errstr + pos, "%s: %s\n", errors->key, errors->value); - - pos = len; + if (strcmp(errors->key, "msg") == 0) { + errstr = estrdup(errors->value); + break; + } + errors = errors->next; } @@ -1427,6 +1416,8 @@ php_error(E_WARNING, errstr); break; } + + efree(errstr); } /* }}} */

« previous php.cvs (#3666) next »