From ae7c84e27c72f85ce840db6261080d1187adeb4f Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 31 Jan 2017 11:42:30 +0100 Subject: listen: Fix comparison broken by limited range of types. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -DHAVE_CONFIG_H -I. -I.. -O2 -Wall -Wextra -pedantic -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c utils.c: In function ‘lprintf’: utils.c:73:27: warning: comparison is always true due to limited range of data type [-Wtype-limits] || (*p > 126 && *p < 160 && sevenbit)) ^ Signed-off-by: Ralf Baechle --- listen/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'listen/utils.c') diff --git a/listen/utils.c b/listen/utils.c index aa4d9e2..cf1a796 100644 --- a/listen/utils.c +++ b/listen/utils.c @@ -70,7 +70,7 @@ void lprintf(int dtype, char *fmt, ...) } else { for (p = str; *p != '\0'; p++) if ((*p < 32 && *p != '\n') - || (*p > 126 && *p < 160 && sevenbit)) + || (*p > 126 && (unsigned char) *p < 160 && sevenbit)) *p = '.'; if (fputs(str, stdout) == -1) exit(1); -- cgit v1.2.3