aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/wc.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/wc.c')
-rw-r--r--toys/posix/wc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toys/posix/wc.c b/toys/posix/wc.c
index a9c588e8..56c9673a 100644
--- a/toys/posix/wc.c
+++ b/toys/posix/wc.c
@@ -63,10 +63,8 @@ static void do_wc(int fd, char *name)
if (CFG_TOYBOX_I18N && (toys.optflags&FLAG_m)) {
clen = mbrtowc(&wchar, toybuf+i, len-i, 0);
if (clen == -1) {
- if (i != len-1) {
- clen = 1;
- continue;
- } else break;
+ clen = 1;
+ continue;
}
if (clen == -2) break;
if (clen == 0) clen=1;