From 95584d3b3309ff4da4cc458254df383f5cff044b Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Sun, 23 Oct 2011 13:34:15 -0400 Subject: Fix signedness in wcscmp comparison --- wcsmbs/wcscmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wcsmbs') 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) -- cgit 1.4.1