projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aee9b15
)
fix return value computation in one code path of wcsnrtombs
author
Rich Felker
<dalias@aerifal.cx>
Thu, 18 Dec 2014 21:42:21 +0000
(16:42 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 18 Dec 2014 21:42:21 +0000
(16:42 -0500)
the affected code was wrongly counting characters instead of bytes.
src/multibyte/wcsnrtombs.c
patch
|
blob
|
history
diff --git
a/src/multibyte/wcsnrtombs.c
b/src/multibyte/wcsnrtombs.c
index 7eb05d459ab826fbba890d52796302d799b1b251..ee4a534ab0c5131991a9af15c612f63391cf8d27 100644
(file)
--- 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;