diff options
Diffstat (limited to 'wcsmbs/wcsnrtombs.c')
-rw-r--r-- | wcsmbs/wcsnrtombs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsmbs/wcsnrtombs.c b/wcsmbs/wcsnrtombs.c index ddd4e95..f6c8048 100644 --- a/wcsmbs/wcsnrtombs.c +++ b/wcsmbs/wcsnrtombs.c @@ -63,7 +63,12 @@ __wcsnrtombs (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) { |