]> gcc.gnu.org Git - gcc.git/commitdiff
decNumber.c (decStrEq): Cast string contents to unsigned char instead of int before...
authorRoger Sayle <roger@eyesopen.com>
Tue, 20 Dec 2005 18:48:47 +0000 (18:48 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 20 Dec 2005 18:48:47 +0000 (18:48 +0000)
        * decNumber.c (decStrEq): Cast string contents to unsigned char
        instead of int before calling tolower.

From-SVN: r108862

libdecnumber/ChangeLog
libdecnumber/decNumber.c

index f7368a44c347bd75c276ca1456b9de8c7c1ec340..706beaaa0a5cadbbcd46a47ee6a95cacc8d14516 100644 (file)
@@ -1,3 +1,8 @@
+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
index 0625e9f2541b442ffc2875f264e3ecd6e33224bc..bc11ace87872996d2914768d3cec8f79d6a1e12d 100644 (file)
@@ -5438,14 +5438,16 @@ decStrEq (const char *str1, const char *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;
        }
       else
        {
-         if (tolower ((int) *str1) != tolower ((int) *str2))
+         if (tolower (u1) != tolower (u2))
            return 0;
        }
     }                          /* stepping */
This page took 0.066133 seconds and 5 git commands to generate.