From 7c5ae9a1cf3e65afadb4ba3cf50a0690e7d4d27d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Nov 2014 11:03:54 +0100 Subject: fix unsigned check --- sapi/apache2handler/php_functions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sapi/apache2handler/php_functions.c') diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index d9ae4d97ea..f32c881e05 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -388,8 +388,12 @@ PHP_MINFO_FUNCTION(apache) } smart_str_appendc(&tmp1, ' '); } - if (tmp1.s && (tmp1.s->len - 1) >= 0) { - tmp1.s->val[tmp1.s->len - 1] = '\0'; + if (tmp1.s) { + if (tmp1.s->len > 0) { + tmp1.s->val[tmp1.s->len - 1] = '\0'; + } else { + tmp1.s->val[0] = '\0'; + } } php_info_print_table_start(); -- cgit v1.2.1