From: jjohnstn Date: Thu, 28 Aug 2008 17:36:48 +0000 (+0000) Subject: 2008-08-28 Corinna Vinschen X-Git-Tag: cgen-snapshot-20091101~5598 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=20ec3f1f1bad509be5ec54d4ff22bbeb98c729b9;p=pf3gnuchains%2Fpf3gnuchains4x.git 2008-08-28 Corinna Vinschen * libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Optimize condition for accepting a converted character. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 82e80155d9..0304993448 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2008-08-28 Corinna Vinschen + + * libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Optimize condition + for accepting a converted character. + 2008-08-27 Sandra Loosemore * libc/libc.texinfo: Remove "LOCAL KLUGE" that prevents it diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c index 3c1dc46261..a16d36cf67 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)