From: Felipe Pena Date: Tue, 12 Nov 2013 15:10:29 +0000 (-0200) Subject: - Simplify code X-Git-Tag: php-5.6.0alpha1~110^2~420 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edbb1313a1f3f6ecae11a0d120db3c2f4c381f00;p=php - Simplify code --- diff --git a/phpdbg_utils.c b/phpdbg_utils.c index b509900912..4ad75acd10 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -52,19 +52,15 @@ int phpdbg_is_addr(const char *str) /* {{{ */ int phpdbg_is_class_method(const char *str, size_t len, char **class, char **method) /* {{{ */ { const char *sep = strstr(str, "::"); - size_t class_len, method_len; if (!sep || sep == str || sep+2 == str+len-1) { return 0; } - class_len = sep - str; - method_len = len - ((sep+2) - str); + *class = estrndup(str, sep - str); + class[sep - str] = 0; - *class = estrndup(str, class_len); - class[class_len] = 0; - - *method = estrndup(sep+2, method_len+1); + *method = estrndup(sep+2, str + len - sep); return 1; } /* }}} */ diff --git a/test.php b/test.php index 06e855bfd3..457e487db7 100644 --- a/test.php +++ b/test.php @@ -13,6 +13,6 @@ function test2() { $my = new my(); var_dump($my->method()); -phpdbg_break(); + return true; ?>