From: Josh Triplett Date: Fri, 8 Jul 2016 07:29:59 +0000 (-0700) Subject: watch: Fix ANSI escape sequence termination X-Git-Tag: v4.0.0~829 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5207a1e98acb4ca57a5b3c833a2e53b5651ad179;p=procps-ng 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 --- 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;