summaryrefslogtreecommitdiff
path: root/libdecnumber
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-20 18:48:47 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-20 18:48:47 +0000
commitbe4ac9632a5b745f977d8cef9b278837f6648759 (patch)
tree5a73454edc8c2433429e25ebaab60b0adf3a3f52 /libdecnumber
parentc6fdac18a1388334f3b1f08285ae371061e37bdb (diff)
downloadgcc-be4ac9632a5b745f977d8cef9b278837f6648759.tar.gz
* decNumber.c (decStrEq): Cast string contents to unsigned char
instead of int before calling tolower. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108862 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libdecnumber')
-rw-r--r--libdecnumber/ChangeLog5
-rw-r--r--libdecnumber/decNumber.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/libdecnumber/ChangeLog b/libdecnumber/ChangeLog
index f7368a44c34..706beaaa0a5 100644
--- a/libdecnumber/ChangeLog
+++ b/libdecnumber/ChangeLog
@@ -1,5 +1,10 @@
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
tolower to avoid compilation warnings on Tru64.
diff --git a/libdecnumber/decNumber.c b/libdecnumber/decNumber.c
index 0625e9f2541..bc11ace8787 100644
--- a/libdecnumber/decNumber.c
+++ b/libdecnumber/decNumber.c
@@ -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 */