aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-09-02 18:15:09 -0500
committerRob Landley <rob@landley.net>2017-09-02 18:15:09 -0500
commit67ddade3373d0fefeff25b48430e5f08c3a7711b (patch)
treeead8c34b2a28655eef456b0afa104a438cae2a02 /toys/posix
parentbebf14cc298eb41d8e5c245e3800aea69ecca08c (diff)
downloadtoybox-67ddade3373d0fefeff25b48430e5f08c3a7711b.tar.gz
In wc, replace mbrtowc() with new utf8towc() which doesn't have a context struct
or care about locale.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/wc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/posix/wc.c b/toys/posix/wc.c
index a8c3e452..96ff9788 100644
--- a/toys/posix/wc.c
+++ b/toys/posix/wc.c
@@ -80,6 +80,7 @@ static void do_wc(int fd, char *name)
// next wide size, don't count invalid, fetch more data if necessary
clen = mbrtowc(&wchar, toybuf+pos, len-pos, 0);
+ clen = utf8towc(&wchar, toybuf+pos, len-pos);
if (clen == -1) continue;
if (clen == -2 && !done) break;