aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/grep.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-05-15 11:14:03 -0500
committerRob Landley <rob@landley.net>2021-05-15 11:14:03 -0500
commitd3025b14b9c13286b79f256d019a99da9425ea0e (patch)
tree02a40c59346677cb5f6a51137f4a39d16ae6b743 /toys/posix/grep.c
parent08481ee37ad5070ff1033d57351c3fa456d0729d (diff)
downloadtoybox-d3025b14b9c13286b79f256d019a99da9425ea0e.tar.gz
Convert utf8towc from wchar_t to unsigned (to match wctoutf8).
The maximum unicode code point is 0x10ffff which is 21 bits.
Diffstat (limited to 'toys/posix/grep.c')
-rw-r--r--toys/posix/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/grep.c b/toys/posix/grep.c
index 52d10139..8eb3c03a 100644
--- a/toys/posix/grep.c
+++ b/toys/posix/grep.c
@@ -124,7 +124,7 @@ static void do_grep(int fd, char *name)
if (!FLAG(a) && !lseek(fd, 0, SEEK_CUR)) {
char buf[256];
int len, i = 0;
- wchar_t wc;
+ unsigned wc;
// If the first 256 bytes don't parse as utf8, call it binary.
if (0<(len = read(fd, buf, 256))) {