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:
Rich Felker 2014-12-18 16:42:21 -05:00
parent aee9b15262
commit 2e1ae3b6b9
1 changed files with 1 additions and 1 deletions

View File

@ -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;