diff options
author | Sterling Hughes <sterling@php.net> | 2001-01-17 14:14:22 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2001-01-17 14:14:22 +0000 |
commit | db50ae2e7dc88b4693a57076a01963e7b97ef40d (patch) | |
tree | d7de9722974ec069b56550fed1e27839c6635889 | |
parent | c927c254ddbad9b116be41031742b9d434bae0ff (diff) | |
download | php-git-db50ae2e7dc88b4693a57076a01963e7b97ef40d.tar.gz |
Fix (well it works) the error display with sablotron.
-rw-r--r-- | ext/sablot/sablot.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/ext/sablot/sablot.c b/ext/sablot/sablot.c index d8a0460e50..2987d3d26b 100644 --- a/ext/sablot/sablot.c +++ b/ext/sablot/sablot.c @@ -1394,27 +1394,16 @@ static MH_ERROR _php_sablot_error(void *userData, SablotHandle p, MH_ERROR code, 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 @@ static void _php_sablot_standard_error(php_sablot_error *errors, php_sablot_erro php_error(E_WARNING, errstr); break; } + + efree(errstr); } /* }}} */ |