aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/wc.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-12-01 11:03:52 -0600
committerRob Landley <rob@landley.net>2012-12-01 11:03:52 -0600
commit55970d0c2c0c78ebe386cf000129435476057817 (patch)
tree42e7f106b41f6044f82debc3f724d2c5ccc0873f /toys/posix/wc.c
parented7abaf0968a850e262a2ae8f5a8e0b41aaa5879 (diff)
downloadtoybox-55970d0c2c0c78ebe386cf000129435476057817.tar.gz
Minor cleanup: unify two codepaths that do the same thing.
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;