summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2013-05-02 19:17:48 +0000
committerJoerg Sonnenberger <joerg@bec.de>2013-05-02 19:17:48 +0000
commitaa05f9eaf3db4c3d7251a1277691753c1fc68558 (patch)
treee23d70964e730a0bc2fca39c968db0a023d94597 /libcxx/src
parentc049c929333be7c0b48fe89bfc786e8950d496e9 (diff)
downloadbcm5719-llvm-aa05f9eaf3db4c3d7251a1277691753c1fc68558.tar.gz
bcm5719-llvm-aa05f9eaf3db4c3d7251a1277691753c1fc68558.zip
Add explicit casts to unsigned char before calling ctype functions.
Fixes the value range on platforms with signed char. llvm-svn: 180940
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/locale.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 49c1cf22301..c740a51fa49 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -1068,28 +1068,28 @@ ctype_byname<char>::~ctype_byname()
char
ctype_byname<char>::do_toupper(char_type c) const
{
- return static_cast<char>(toupper_l(c, __l));
+ return static_cast<char>(toupper_l(static_cast<unsigned char>(c), __l));
}
const char*
ctype_byname<char>::do_toupper(char_type* low, const char_type* high) const
{
for (; low != high; ++low)
- *low = static_cast<char>(toupper_l(*low, __l));
+ *low = static_cast<char>(toupper_l(static_cast<unsigned char>(*low), __l));
return low;
}
char
ctype_byname<char>::do_tolower(char_type c) const
{
- return static_cast<char>(tolower_l(c, __l));
+ return static_cast<char>(tolower_l(static_cast<unsigned char>(c), __l));
}
const char*
ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
{
for (; low != high; ++low)
- *low = static_cast<char>(tolower_l(*low, __l));
+ *low = static_cast<char>(tolower_l(static_cast<unsigned char>(*low), __l));
return low;
}
OpenPOWER on IntegriCloud