From d51242018a1e722cfe0abc65de412bcd49825ebc Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 22 Jan 2013 05:39:34 +0000 Subject: When copying the complement of the string loop to WINT_MAX as we are dealing with a wint_t. WINT_MAX and WCHAR_MAX are the same on most architectures except ARM EABI where wint_t is signed and wchar_t is unsigned. --- usr.bin/tr/tr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index c2b6bf8..6eea2cb 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95"; #include #include #include +#include #include #include #include @@ -267,7 +268,7 @@ endloop: */ s2.str = argv[1]; s2.state = NORMAL; - for (cnt = 0; cnt < WCHAR_MAX; cnt++) { + for (cnt = 0; cnt < WINT_MAX; cnt++) { if (Cflag && !iswrune(cnt)) continue; if (cmap_lookup(map, cnt) == OOBCH) { -- cgit v1.1