Commit 7d0e5156 by Roger Sayle Committed by Roger Sayle

decNumber.c (decStrEq): Cast string contents to unsigned char instead of int…

decNumber.c (decStrEq): Cast string contents to unsigned char instead of int before calling tolower.


        * decNumber.c (decStrEq): Cast string contents to unsigned char
        instead of int before calling tolower.

From-SVN: r108862
parent 5e739d00
2005-12-20 Roger Sayle <roger@eyesopen.com> 2005-12-20 Roger Sayle <roger@eyesopen.com>
* decNumber.c (decStrEq): Cast string contents to unsigned char
instead of int before calling tolower.
2005-12-20 Roger Sayle <roger@eyesopen.com>
* decNumber.c (decStrEq): Cast operands to int before calling * decNumber.c (decStrEq): Cast operands to int before calling
tolower to avoid compilation warnings on Tru64. tolower to avoid compilation warnings on Tru64.
......
...@@ -5438,14 +5438,16 @@ decStrEq (const char *str1, const char *str2) ...@@ -5438,14 +5438,16 @@ decStrEq (const char *str1, const char *str2)
{ {
for (;; str1++, str2++) for (;; str1++, str2++)
{ {
if (*str1 == *str2) unsigned char u1 = (unsigned char) *str1;
unsigned char u2 = (unsigned char) *str2;
if (u1 == u2)
{ {
if (*str1 == '\0') if (u1 == '\0')
break; break;
} }
else else
{ {
if (tolower ((int) *str1) != tolower ((int) *str2)) if (tolower (u1) != tolower (u2))
return 0; return 0;
} }
} /* stepping */ } /* stepping */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment