From d5719e89ef0bbfa7eb82b4ec6d5bc4ef0416b279 Mon Sep 17 00:00:00 2001 From: stefanf Date: Sat, 12 Feb 2005 08:45:12 +0000 Subject: Fix comparisons that test if an unsigned value is < 0. Reviewed by: tjr --- lib/libc/locale/utf8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/locale/utf8.c') diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 8ef7b9a..2f55ffd 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -388,7 +388,7 @@ _UTF8_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, *dst = *s; } else if (len > (size_t)MB_CUR_MAX) { /* Enough space to translate in-place. */ - if ((nb = (int)_UTF8_wcrtomb(dst, *s, ps)) < 0) { + if ((nb = _UTF8_wcrtomb(dst, *s, ps)) == (size_t)-1) { *src = s; return ((size_t)-1); } @@ -396,7 +396,7 @@ _UTF8_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, /* * May not be enough space; use temp. buffer. */ - if ((nb = (int)_UTF8_wcrtomb(buf, *s, ps)) < 0) { + if ((nb = _UTF8_wcrtomb(buf, *s, ps)) == (size_t)-1) { *src = s; return ((size_t)-1); } -- cgit v1.1