From bb02989f421dbd63aec7ce7c50156ab470168cf4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 28 May 2020 21:35:00 +0000 Subject: [PATCH] [core] use the more efficient mult-byte tolower/toupper in the helper func --- src/include/switch_utils.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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; }