diff options
Diffstat (limited to 'wcsmbs/wmemrtombs.c')
-rw-r--r-- | wcsmbs/wmemrtombs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsmbs/wmemrtombs.c b/wcsmbs/wmemrtombs.c index 2bbd66788e..5b8e39cbe3 100644 --- a/wcsmbs/wmemrtombs.c +++ b/wcsmbs/wmemrtombs.c @@ -63,7 +63,12 @@ __wmemrtombs (dst, src, nwc, len, ps) while (written < len && nwc-- > 0) { - wchar_t wc = *run++; + wchar_t wc; + + /* Store position of first unprocessed word. */ + *src = run; + + wc = *run++; if (wc < 0 || wc > 0x7fffffff) { |