From: Rich Felker Date: Thu, 18 Dec 2014 21:42:21 +0000 (-0500) Subject: fix return value computation in one code path of wcsnrtombs X-Git-Tag: v1.1.6~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1;p=oweals%2Fmusl.git fix return value computation in one code path of wcsnrtombs the affected code was wrongly counting characters instead of bytes. --- diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c index 7eb05d45..ee4a534a 100644 --- a/src/multibyte/wcsnrtombs.c +++ b/src/multibyte/wcsnrtombs.c @@ -40,7 +40,7 @@ size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, s ws++; wn--; /* safe - this loop runs fewer than sizeof(buf) times */ s+=l; n-=l; - cnt++; + cnt += l; } if (dst) *wcs = ws; return cnt;