From: Rich Felker Date: Sat, 29 Jun 2013 20:16:47 +0000 (-0400) Subject: fix failure of mbsrtowcs to record stop position when dest is full X-Git-Tag: v0.9.11~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4ca442157e381690202c3bcc102627d137fd0466;p=oweals%2Fmusl.git fix failure of mbsrtowcs to record stop position when dest is full --- 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++;