Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2008-08-28 21:36:49 +0400
committerJeff Johnston <jjohnstn@redhat.com>2008-08-28 21:36:49 +0400
commit60ac13a0b0676a6896b116309c93090fc140f23b (patch)
treec332fbb04aca605367c549af454a93358d819730
parentbfe1d1484760df34695b8be2eec8f3bc035031b9 (diff)
2008-08-28 Corinna Vinschen <corinna@vinschen.de>
* libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Optimize condition for accepting a converted character.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdlib/wcsrtombs.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 82e80155d..030499344 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Optimize condition
+ for accepting a converted character.
+
2008-08-27 Sandra Loosemore <sandra@codesourcery.com>
* libc/libc.texinfo: Remove "LOCAL KLUGE" that prevents it
diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c
index 3c1dc4626..a16d36cf6 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)