From 95d85fcb1ad3fc0eeffa8e6b26bee429983116e3 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 2 Mar 2009 23:30:59 +0000 Subject: 2009-03-02 Jeff Johnston * libc/stdlib/wctomb_r.c (_wctomb_r): When checking single-byte charset, cast wchar to size_t in case wchar_t is signed. * libc/stdlib/wctomb.c (wctomb): Add similar single-byte check. --- newlib/libc/stdlib/wctomb_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libc/stdlib/wctomb_r.c') diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 11418b564..b5205fcaa 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -207,7 +207,7 @@ _DEFUN (_wctomb_r, (r, s, wchar, state), return 0; /* otherwise we are dealing with a single byte character */ - if (wchar >= 0x100) + if ((size_t)wchar >= 0x100) { r->_errno = EILSEQ; return -1; -- cgit v1.2.3