From: Anthony Minessale Date: Thu, 28 May 2020 21:35:00 +0000 (+0000) Subject: [core] use the more efficient mult-byte tolower/toupper in the helper func X-Git-Tag: v1.10.7^2~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb02989f421dbd63aec7ce7c50156ab470168cf4;p=thirdparty%2Ffreeswitch.git [core] use the more efficient mult-byte tolower/toupper in the helper func --- diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 649ad926b3..41b2436538 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -888,13 +888,10 @@ static inline char *switch_safe_strdup(const char *it) static inline char *switch_lc_strdup(const char *it) { char *dup; - char *p; if (it) { dup = strdup(it); - for (p = dup; p && *p; p++) { - *p = (char) switch_tolower(*p); - } + switch_tolower_max(dup); return dup; } @@ -905,13 +902,10 @@ static inline char *switch_lc_strdup(const char *it) static inline char *switch_uc_strdup(const char *it) { char *dup; - char *p; if (it) { dup = strdup(it); - for (p = dup; p && *p; p++) { - *p = (char) switch_toupper(*p); - } + switch_toupper_max(dup); return dup; }