summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/astring.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/astring.c')
-rw-r--r--src/lib/util/astring.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c
index cb5d23098a3..48f30fa83d4 100644
--- a/src/lib/util/astring.c
+++ b/src/lib/util/astring.c
@@ -498,9 +498,9 @@ int astring_icmpc(const astring *str1, const char *str2)
const char *s1 = str1->text;
/* loop while equal until we hit the end of strings */
- while (*s1 != 0 && *str2 != 0 && tolower(*s1) == tolower(*str2))
+ while (*s1 != 0 && *str2 != 0 && tolower((UINT8)*s1) == tolower((UINT8)*str2))
s1++, str2++;
- return tolower(*s1) - tolower(*str2);
+ return tolower((UINT8)*s1) - tolower((UINT8)*str2);
}
@@ -515,9 +515,9 @@ int astring_icmpch(const astring *str1, const char *str2, int count)
int result;
/* loop while equal until we hit the end of strings */
- while (count-- > 0 && *s1 != 0 && *str2 != 0 && tolower(*s1) == tolower(*str2))
+ while (count-- > 0 && *s1 != 0 && *str2 != 0 && tolower((UINT8)*s1) == tolower((UINT8)*str2))
s1++, str2++;
- result = (count == -1) ? 0 : tolower(*s1) - tolower(*str2);
+ result = (count == -1) ? 0 : tolower((UINT8)*s1) - tolower((UINT8)*str2);
if (result == 0 && *s1 != 0)
result = 1;
return result;
@@ -669,7 +669,7 @@ astring *astring_toupper(astring *str)
/* just toupper() on all characters */
for (text = str->text; *text != 0; text++)
- *text = toupper(*text);
+ *text = toupper((UINT8)*text);
return str;
}
@@ -686,7 +686,7 @@ astring *astring_tolower(astring *str)
/* just tolower() on all characters */
for (text = str->text; *text != 0; text++)
- *text = tolower(*text);
+ *text = tolower((UINT8)*text);
return str;
}
@@ -702,11 +702,11 @@ astring *astring_trimspace(astring *str)
char *ptr;
/* first remove stuff from the end */
- for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && (!(*ptr & 0x80) && isspace(*ptr)); ptr--)
+ for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && (!(*ptr & 0x80) && isspace((UINT8)*ptr)); ptr--)
*ptr = 0;
/* then count how much to remove from the beginning */
- for (ptr = str->text; *ptr != 0 && (!(*ptr & 0x80) && isspace(*ptr)); ptr++) ;
+ for (ptr = str->text; *ptr != 0 && (!(*ptr & 0x80) && isspace((UINT8)*ptr)); ptr++) ;
if (ptr > str->text)
astring_substr(str, ptr - str->text, -1);