From 5207a1e98acb4ca57a5b3c833a2e53b5651ad179 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 8 Jul 2016 00:29:59 -0700 Subject: [PATCH] watch: Fix ANSI escape sequence termination process_ansi stopped processing an ANSI escape sequence if (c < '0' && c > '9' && c != ';'), which will never happen. Fix the range check to use || instead. Signed-off-by: Josh Triplett --- watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watch.c b/watch.c index 17608b5c..c2078089 100644 --- a/watch.c +++ b/watch.c @@ -216,7 +216,7 @@ static void process_ansi(FILE * fp) buf[i] = '\0'; break; } - if (c < '0' && c > '9' && c != ';') { + if ((c < '0' || c > '9') && c != ';') { while (--i >= 0) ungetc(buf[i], fp); return; -- 2.40.0