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:
Diffstat (limited to 'newlib/libc/stdlib/wcsrtombs.c')
-rw-r--r--newlib/libc/stdlib/wcsrtombs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c
index a16d36cf6..6871d0c00 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 + bytes <= len)
+ if (n <= len - bytes && bytes < len)
{
n += bytes;
if (dst)