From 60ac13a0b0676a6896b116309c93090fc140f23b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 28 Aug 2008 17:36:49 +0000 Subject: 2008-08-28 Corinna Vinschen * libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Optimize condition for accepting a converted character. --- newlib/libc/stdlib/wcsrtombs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libc/stdlib/wcsrtombs.c') diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c index 3c1dc46..a16d36c 100644 --- a/newlib/libc/stdlib/wcsrtombs.c +++ b/newlib/libc/stdlib/wcsrtombs.c @@ -45,7 +45,7 @@ _DEFUN (_wcsrtombs_r, (r, dst, src, len, ps), ps->__count = 0; return (size_t)-1; } - if (n <= len - bytes && bytes <= len) + if (n + bytes <= len) { n += bytes; if (dst) -- cgit v1.1