From b9613842c3ac1a874b56dff4d1f8ce80c2dbab9d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 5 Sep 2017 21:04:43 -0500 Subject: Replace remaining mb*towc() calls with utf8towc(). --- toys/posix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/file.c') diff --git a/toys/posix/file.c b/toys/posix/file.c index 658708cb..9958d044 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -267,7 +267,7 @@ static void do_regular_file(int fd, char *name, struct stat *sb) } else for (i = 0; i0 && wcwidth(wc)>=0) { + if ((bytes = utf8towc(&wc, s+i, len-i))>0 && wcwidth(wc)>=0) { i += bytes-1; if (!what) what = "UTF-8 text"; } else { -- cgit v1.2.3