summaryrefslogtreecommitdiff
path: root/src/multibyte
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-12-18 16:42:21 -0500
committerRich Felker <dalias@aerifal.cx>2014-12-18 16:42:21 -0500
commit2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1 (patch)
treec90a5273f8b4e4214c09af194cb3e2d99d96b76c /src/multibyte
parentaee9b1526247f74e9b755b50e102b3b4ce2aac1d (diff)
downloadmusl-2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1.tar.gz
musl-2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1.tar.bz2
musl-2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1.tar.xz
musl-2e1ae3b6b9331383ba5eaa7cb47373a8bea073d1.zip
fix return value computation in one code path of wcsnrtombs
the affected code was wrongly counting characters instead of bytes.
Diffstat (limited to 'src/multibyte')
-rw-r--r--src/multibyte/wcsnrtombs.c2
1 files changed, 1 insertions, 1 deletions
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;