From: David van Moolenbroek Date: Fri, 17 Jun 2016 20:09:08 +0000 (+0000) Subject: cawf(1): remove various redundant comparisons X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F3318%2F1;p=minix.git cawf(1): remove various redundant comparisons Reported by dcb314. This fixes #135, #136. Change-Id: I0f83a92e18adf68e5ad493b9057d093a6b37b328 --- diff --git a/minix/commands/cawf/pass2.c b/minix/commands/cawf/pass2.c index c4b4c6634..b5bedc56c 100644 --- a/minix/commands/cawf/pass2.c +++ b/minix/commands/cawf/pass2.c @@ -104,7 +104,7 @@ void Pass2(unsigned char *line) { * Output each word of the line as " ". */ for (s1 = line;;) { - while (*s1 && *s1 == ' ') + while (*s1 == ' ') s1++; if (*s1 == '\0') break; diff --git a/minix/commands/cawf/string.c b/minix/commands/cawf/string.c index 123aeec7c..5916ca632 100644 --- a/minix/commands/cawf/string.c +++ b/minix/commands/cawf/string.c @@ -43,7 +43,7 @@ int Asmname(unsigned char *s, unsigned char *c) { * code destination (c[3]) */ c[1] = c[2] = '\0'; - while (*s && *s == ' ') + while (*s == ' ') s++; if ((c[0] = *s) == '\0') return(0);