summaryrefslogtreecommitdiff
path: root/src/string/wcsncmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/wcsncmp.c')
-rw-r--r--src/string/wcsncmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/wcsncmp.c b/src/string/wcsncmp.c
index 4ab32a92..2b3558bf 100644
--- a/src/string/wcsncmp.c
+++ b/src/string/wcsncmp.c
@@ -3,5 +3,5 @@
int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n)
{
for (; n && *l==*r && *l && *r; n--, l++, r++);
- return n ? *l - *r : 0;
+ return n ? (*l < *r ? -1 : *l > *r) : 0;
}