[php-src] master: Cleanup php_libxml_internal_error_handler_ex()

From: Date: Tue, 30 Apr 2024 15:29:31 +0000
Subject: [php-src] master: Cleanup php_libxml_internal_error_handler_ex()
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128265@lists.php.net to get a copy of this message
Author: Niels Dossche (nielsdos) Date: 2024-04-30T17:29:19+02:00 Commit: https://github.com/php/php-src/commit/974edc793921aad91a670e22baba05d6a0ba376d Raw diff: https://github.com/php/php-src/commit/974edc793921aad91a670e22baba05d6a0ba376d.diff Cleanup php_libxml_internal_error_handler_ex() Changed paths: M ext/libxml/libxml.c Diff: diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index b249dc2358a4..5fec0fa7ba3c 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -639,22 +639,22 @@ void php_libxml_issue_error(int level, const char *msg) static void php_libxml_internal_error_handler_ex(php_libxml_error_level error_type, void *ctx, const char *msg, va_list ap, int line, int column) { char *buf; - int len, len_iter, output = 0; + bool output = false; - len = vspprintf(&buf, 0, msg, ap); - len_iter = len; + size_t len = vspprintf(&buf, 0, msg, ap); + size_t len_iter = len; /* remove any trailing \n */ while (len_iter && buf[--len_iter] == '\n') { buf[len_iter] = '\0'; - output = 1; + output = true; } smart_str_appendl(&LIBXML(error_buffer), buf, len); efree(buf); - if (output == 1) { + if (output) { if (LIBXML(error_list)) { _php_list_set_error_structure(NULL, ZSTR_VAL(LIBXML(error_buffer).s), line, column); } else if (!EG(exception)) {

« previous php.cvs (#128265) next »