diff --git a/main/getopt.c b/main/getopt.c index 85871f164020a..65ce94ae9bb05 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -97,7 +97,7 @@ PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char arg_start = 2; /* Check for = */ - if ((pos = php_memnstr(&argv[*optind][arg_start], "=", 1, argv[*optind]+arg_end)) != NULL) { + if ((pos = memchr(&argv[*optind][arg_start], '=', arg_end - arg_start)) != NULL) { arg_end = pos-&argv[*optind][arg_start]; arg_start++; } else {