diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-21 20:51:53 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-21 20:51:53 +0000 |
commit | 5e7a0a2305074f981877658ce8757f724543175b (patch) | |
tree | da0f261c2091d8c049c3b6d2fe7280f6763ef07e /libgfortran | |
parent | 436a23793bc7393f375830288cf6b0ec76c99009 (diff) | |
download | ppe42-gcc-5e7a0a2305074f981877658ce8757f724543175b.tar.gz ppe42-gcc-5e7a0a2305074f981877658ce8757f724543175b.zip |
2007-01-21 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30525
* intrinsics/string_intrinsics.c(compare_string): Make
sure that comparisons are done unsigned.
2007-01-21 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30525
* gfortran.dg/char_comparison_1.f: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121035 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/intrinsics/string_intrinsics.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d81546ff47e..f12f83ee441 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-01-21 Thomas Koenig <Thomas.Koenig@online.de> + + PR libfortran/30525 + * intrinsics/string_intrinsics.c(compare_string): Make + sure that comparisons are done unsigned. + 2006-12-09 Tobias Burnus <burnus@net-b.de> PR libfortran/30015 diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index fdaddef3327..e432987dcad 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -83,7 +83,7 @@ compare_string (GFC_INTEGER_4 len1, const char * s1, GFC_INTEGER_4 len2, const char * s2) { int res; - const char *s; + const unsigned char *s; int len; res = memcmp (s1, s2, (len1 < len2) ? len1 : len2); @@ -96,13 +96,13 @@ compare_string (GFC_INTEGER_4 len1, const char * s1, if (len1 < len2) { len = len2 - len1; - s = &s2[len1]; + s = (unsigned char *) &s2[len1]; res = -1; } else { len = len1 - len2; - s = &s1[len2]; + s = (unsigned char *) &s1[len2]; res = 1; } |