Skip to content

Commit 974edc7

Browse files
committed
Cleanup php_libxml_internal_error_handler_ex()
1 parent e5e8b19 commit 974edc7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/libxml/libxml.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -639,22 +639,22 @@ void php_libxml_issue_error(int level, const char *msg)
639639
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)
640640
{
641641
char *buf;
642-
int len, len_iter, output = 0;
642+
bool output = false;
643643

644-
len = vspprintf(&buf, 0, msg, ap);
645-
len_iter = len;
644+
size_t len = vspprintf(&buf, 0, msg, ap);
645+
size_t len_iter = len;
646646

647647
/* remove any trailing \n */
648648
while (len_iter && buf[--len_iter] == '\n') {
649649
buf[len_iter] = '\0';
650-
output = 1;
650+
output = true;
651651
}
652652

653653
smart_str_appendl(&LIBXML(error_buffer), buf, len);
654654

655655
efree(buf);
656656

657-
if (output == 1) {
657+
if (output) {
658658
if (LIBXML(error_list)) {
659659
_php_list_set_error_structure(NULL, ZSTR_VAL(LIBXML(error_buffer).s), line, column);
660660
} else if (!EG(exception)) {

0 commit comments

Comments
 (0)