summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-02-12 08:45:12 +0000
committerstefanf <stefanf@FreeBSD.org>2005-02-12 08:45:12 +0000
commitd5719e89ef0bbfa7eb82b4ec6d5bc4ef0416b279 (patch)
tree032b1988833a6bfd17a44827ca8b5ec5b7f28716
parent7020493859cd381e6252681fd3ed8fb6aa77e445 (diff)
downloadFreeBSD-src-d5719e89ef0bbfa7eb82b4ec6d5bc4ef0416b279.zip
FreeBSD-src-d5719e89ef0bbfa7eb82b4ec6d5bc4ef0416b279.tar.gz
Fix comparisons that test if an unsigned value is < 0.
Reviewed by: tjr
-rw-r--r--lib/libc/locale/utf8.c4
-rw-r--r--lib/libc/locale/wcsnrtombs.c4
2 files changed, 4 insertions, 4 deletions
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);
}
diff --git a/lib/libc/locale/wcsnrtombs.c b/lib/libc/locale/wcsnrtombs.c
index 68d6b5c..e899698 100644
--- a/lib/libc/locale/wcsnrtombs.c
+++ b/lib/libc/locale/wcsnrtombs.c
@@ -73,7 +73,7 @@ __wcsnrtombs_std(char * __restrict dst, const wchar_t ** __restrict src,
while (len > 0 && nwc-- > 0) {
if (len > (size_t)MB_CUR_MAX) {
/* Enough space to translate in-place. */
- if ((nb = (int)__wcrtomb(dst, *s, ps)) < 0) {
+ if ((nb = __wcrtomb(dst, *s, ps)) == (size_t)-1) {
*src = s;
return ((size_t)-1);
}
@@ -86,7 +86,7 @@ __wcsnrtombs_std(char * __restrict dst, const wchar_t ** __restrict src,
* character is too long for the buffer.
*/
mbsbak = *ps;
- if ((nb = (int)__wcrtomb(buf, *s, ps)) < 0) {
+ if ((nb = __wcrtomb(buf, *s, ps)) == (size_t)-1) {
*src = s;
return ((size_t)-1);
}
OpenPOWER on IntegriCloud