summaryrefslogtreecommitdiff
path: root/wcsmbs/wcscmp.c
diff options
context:
space:
mode:
authorLiubov Dmitrieva <liubov.dmitrieva@gmail.com>2011-10-23 13:34:15 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-23 13:34:15 -0400
commit95584d3b3309ff4da4cc458254df383f5cff044b (patch)
tree2b8c9a0284e2b33c15b1d7cc48ef6e72d1a9207e /wcsmbs/wcscmp.c
parent774a2669af652979ed965d7225502ba473b2da73 (diff)
downloadglibc-95584d3b3309ff4da4cc458254df383f5cff044b.tar.gz
Fix signedness in wcscmp comparison
Diffstat (limited to 'wcsmbs/wcscmp.c')
-rw-r--r--wcsmbs/wcscmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wcsmbs/wcscmp.c b/wcsmbs/wcscmp.c
index 6c93f702f6..ddbd4aa93f 100644
--- a/wcsmbs/wcscmp.c
+++ b/wcsmbs/wcscmp.c
@@ -37,11 +37,11 @@ WCSCMP (s1, s2)
{
c1 = (wint_t) *s1++;
c2 = (wint_t) *s2++;
- if (c1 == L'\0')
+ if (c2 == L'\0')
return c1 - c2;
}
while (c1 == c2);
- return c1 - c2;
+ return c1 < c2 ? -1 : 1;
}
libc_hidden_def (WCSCMP)