diff options
author | twosee <twose@qq.com> | 2020-06-07 17:01:19 +0800 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-06-08 10:38:45 +0200 |
commit | 88355dd338835f7a59415ecb2e7e970658f3867f (patch) | |
tree | f203c58d7656c341273565e2d6fb84d89837bad2 /sapi/phpdbg/phpdbg_print.c | |
parent | f6db43fec8da3d3c0c7def077e9f493ce6129c45 (diff) | |
download | php-git-88355dd338835f7a59415ecb2e7e970658f3867f.tar.gz |
Constify char * arguments of APIs
Closes GH-5676.
Diffstat (limited to 'sapi/phpdbg/phpdbg_print.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_print.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 7cc84b72dc..df925b6402 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -375,7 +375,7 @@ void phpdbg_print_opcodes_class(const char *class) { phpdbg_print_opcodes_ce(ce); } -PHPDBG_API void phpdbg_print_opcodes(char *function) +PHPDBG_API void phpdbg_print_opcodes(const char *function) { if (function == NULL) { phpdbg_print_opcodes_main(); @@ -401,12 +401,12 @@ PHPDBG_API void phpdbg_print_opcodes(char *function) } } ZEND_HASH_FOREACH_END(); } else { - function = zend_str_tolower_dup(function, strlen(function)); + char *function_lowercase = zend_str_tolower_dup(function, strlen(function)); - if (strstr(function, "::") == NULL) { - phpdbg_print_opcodes_function(function, strlen(function)); + if (strstr(function_lowercase, "::") == NULL) { + phpdbg_print_opcodes_function(function_lowercase, strlen(function_lowercase)); } else { - char *method_name, *class_name = strtok(function, "::"); + char *method_name, *class_name = strtok(function_lowercase, "::"); if ((method_name = strtok(NULL, "::")) == NULL) { phpdbg_print_opcodes_class(class_name); } else { @@ -414,6 +414,6 @@ PHPDBG_API void phpdbg_print_opcodes(char *function) } } - efree(function); + efree(function_lowercase); } } |