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:
95c6044
)
fix iconv output of surrogate pairs in ucs2
author
Rich Felker
<dalias@aerifal.cx>
Tue, 19 Dec 2017 03:33:51 +0000
(22:33 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 19 Dec 2017 03:33:51 +0000
(22:33 -0500)
in the unified code for handling utf-16 and ucs2 output, the check for
ucs2 wrongly looked at the source charset rather than the destination
charset.
src/locale/iconv.c
patch
|
blob
|
history
diff --git
a/src/locale/iconv.c
b/src/locale/iconv.c
index c5dd122f7ff280f7ca552270686c358c2e0f06df..d469856c992943b52cd415775c23991450377e37 100644
(file)
--- a/
src/locale/iconv.c
+++ b/
src/locale/iconv.c
@@
-630,7
+630,7
@@
size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
case UTF_16:
case UTF_16BE:
case UTF_16LE:
- if (c < 0x10000 || type-UCS2BE < 2U) {
+ if (c < 0x10000 || t
ot
ype-UCS2BE < 2U) {
if (c >= 0x10000) c = 0xFFFD;
if (*outb < 2) goto toobig;
put_16((void *)*out, c, totype);