Skip to content

Commit 840d800

Browse files
committed
ext/mbstring: Move variable declaration to inner scope
1 parent ce82c48 commit 840d800

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,6 @@ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
844844
/* {{{ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) */
845845
static PHP_INI_MH(OnUpdate_mbstring_substitute_character)
846846
{
847-
int c;
848-
char *endptr = NULL;
849-
850847
if (new_value != NULL) {
851848
if (zend_string_equals_literal_ci(new_value, "none")) {
852849
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE;
@@ -861,7 +858,9 @@ static PHP_INI_MH(OnUpdate_mbstring_substitute_character)
861858
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
862859
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
863860
if (ZSTR_LEN(new_value) > 0) {
864-
c = strtol(ZSTR_VAL(new_value), &endptr, 0);
861+
char *endptr = NULL;
862+
int c = strtol(ZSTR_VAL(new_value), &endptr, 0);
863+
865864
if (*endptr == '\0') {
866865
MBSTRG(filter_illegal_substchar) = c;
867866
MBSTRG(current_filter_illegal_substchar) = c;

0 commit comments

Comments
 (0)