com php-src: - Cosmetic changes: phpdbg_utils.c
| From: | Bob Weinand | Date: | Tue, 19 Nov 2013 21:35:45 +0000 |
| Subject: | com php-src: - Cosmetic changes: phpdbg_utils.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74792@lists.php.net to get a copy of this message | ||
Commit: 2e3723f08f163344ab45f86a34c2bd777b8ed720
Author: Felipe Pena <felipensp@gmail.com> Tue, 19 Nov 2013 19:35:45 -0200
Parents: 3853f5b370c4b8f741e427eb0000dbef01c08dad
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2e3723f08f163344ab45f86a34c2bd777b8ed720
Log:
- Cosmetic changes
Changed paths:
M phpdbg_utils.c
Diff:
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index 4fabd8a..1d015ec 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;