Skip to content

Commit 08af131

Browse files
committed
ext/intl: reuse known string lengths
1 parent 46b1423 commit 08af131

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ext/intl/intl_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ zend_string * intl_error_get_message( intl_error* err )
141141
ZEND_STRL(": "),
142142
uErrorName, uErrorLen);
143143
} else {
144-
errMessage = zend_string_init(uErrorName, strlen(uErrorName), false);
144+
errMessage = zend_string_init(uErrorName, uErrorLen, false);
145145
}
146146

147147
return errMessage;

ext/intl/locale/locale_methods.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ U_CFUNC PHP_FUNCTION( locale_get_keywords )
736736
Z_PARAM_PATH(loc_name, loc_name_len)
737737
ZEND_PARSE_PARAMETERS_END();
738738

739-
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
739+
INTL_CHECK_LOCALE_LEN(loc_name_len);
740740

741741
if(loc_name_len == 0) {
742742
loc_name = (char *)intl_locale_get_default();
@@ -1127,7 +1127,7 @@ U_CFUNC PHP_FUNCTION(locale_parse)
11271127
Z_PARAM_PATH(loc_name, loc_name_len)
11281128
ZEND_PARSE_PARAMETERS_END();
11291129

1130-
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
1130+
INTL_CHECK_LOCALE_LEN(loc_name_len);
11311131

11321132
if(loc_name_len == 0) {
11331133
loc_name = (char *)intl_locale_get_default();

0 commit comments

Comments
 (0)