diff options
author | Anatol Belski <ab@php.net> | 2014-09-14 17:00:06 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-09-14 17:00:06 +0200 |
commit | ad9dc751509a53a7930e8716db6b51b489866328 (patch) | |
tree | 61c09ba84909d19ea49803cae24772a08b14fa20 | |
parent | 29f8b21cd71bc4af1ead7b8a93cfe09338d2eff5 (diff) | |
download | php-git-ad9dc751509a53a7930e8716db6b51b489866328.tar.gz |
avoid strlen() usage in loop
-rw-r--r-- | ext/date/lib/timelib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 716975a90f..4fe327ed59 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -71,10 +71,11 @@ timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel) void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr) { unsigned int i; + size_t tz_abbr_len = strlen(tz_abbr); TIMELIB_TIME_FREE(tm->tz_abbr); tm->tz_abbr = strdup(tz_abbr); - for (i = 0; i < strlen(tz_abbr); i++) { + for (i = 0; i < tz_abbr_len; i++) { tm->tz_abbr[i] = toupper(tz_abbr[i]); } } |