From: Felipe Pena Date: Tue, 19 Nov 2013 21:35:45 +0000 (-0200) Subject: - Cosmetic changes X-Git-Tag: php-5.6.0alpha1~110^2~191^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e3723f08f163344ab45f86a34c2bd777b8ed720;p=php - Cosmetic changes --- diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 4fabd8ab39..1d015ecf8f 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -123,20 +123,20 @@ char *phpdbg_trim(const char *str, size_t len, size_t *new_len) /* {{{ */ --len; } - while (*p && isspace(*(p + len-1))) { + while (*p && isspace(*(p + len -1))) { --len; } if (len == 0) { + new = estrndup("", sizeof("")); *new_len = 0; - return estrndup("", sizeof("")); - } - - new = estrndup(p, len); - *(new + len) = '\0'; + } else { + new = estrndup(p, len); + *(new + len) = '\0'; - if (new_len) { - *new_len = len; + if (new_len) { + *new_len = len; + } } return new;