diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-06-29 16:16:47 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-06-29 16:16:47 -0400 |
commit | 4ca442157e381690202c3bcc102627d137fd0466 (patch) | |
tree | 188c5d6d3ee67ce5985c31b3614cdb2ab894d5d5 /src | |
parent | 9b732fe51b814468a08c84d13238b4c83a42451a (diff) | |
download | musl-4ca442157e381690202c3bcc102627d137fd0466.tar.gz musl-4ca442157e381690202c3bcc102627d137fd0466.tar.bz2 musl-4ca442157e381690202c3bcc102627d137fd0466.tar.xz musl-4ca442157e381690202c3bcc102627d137fd0466.zip |
fix failure of mbsrtowcs to record stop position when dest is full
Diffstat (limited to 'src')
-rw-r--r-- | src/multibyte/mbsrtowcs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/multibyte/mbsrtowcs.c b/src/multibyte/mbsrtowcs.c index 75a493c4..b9bbc33d 100644 --- a/src/multibyte/mbsrtowcs.c +++ b/src/multibyte/mbsrtowcs.c @@ -54,7 +54,10 @@ resume0: wn--; c = 0; } else for (;;) { - if (!wn) return wn0; + if (!wn) { + *src = (const void *)s; + return wn0; + } if (*s-1u < 0x7f && (uintptr_t)s%4 == 0) { while (wn>=4 && !(( *(uint32_t*)s | *(uint32_t*)s-0x01010101) & 0x80808080)) { *ws++ = *s++; |