mirror of
https://github.com/fluencelabs/musl
synced 2025-06-30 07:02:41 +00:00
fix return value computation in one code path of wcsnrtombs
the affected code was wrongly counting characters instead of bytes.
This commit is contained in:
@ -40,7 +40,7 @@ size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, s
|
|||||||
ws++; wn--;
|
ws++; wn--;
|
||||||
/* safe - this loop runs fewer than sizeof(buf) times */
|
/* safe - this loop runs fewer than sizeof(buf) times */
|
||||||
s+=l; n-=l;
|
s+=l; n-=l;
|
||||||
cnt++;
|
cnt += l;
|
||||||
}
|
}
|
||||||
if (dst) *wcs = ws;
|
if (dst) *wcs = ws;
|
||||||
return cnt;
|
return cnt;
|
||||||
|
Reference in New Issue
Block a user