aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs/wcscmp.c
diff options
context:
space:
mode:
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)