]> Zhao Yanbai Git Server - minix.git/commitdiff
cawf(1): remove various redundant comparisons 18/3318/1
authorDavid van Moolenbroek <david@minix3.org>
Fri, 17 Jun 2016 20:09:08 +0000 (20:09 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Fri, 17 Jun 2016 20:09:08 +0000 (20:09 +0000)
Reported by dcb314.

This fixes #135, #136.

Change-Id: I0f83a92e18adf68e5ad493b9057d093a6b37b328

minix/commands/cawf/pass2.c
minix/commands/cawf/string.c

index c4b4c6634ac7b3be13ea854c284d53d1c9eef4ef..b5bedc56c4ce4bbdb5c7553ac294eb1db9279686 100644 (file)
@@ -104,7 +104,7 @@ void Pass2(unsigned char *line) {
                     * Output each word of the line as "<length> <word>".
                     */
                        for (s1 = line;;) {
-                               while (*s1 && *s1 == ' ')
+                               while (*s1 == ' ')
                                        s1++;
                                if (*s1 == '\0')
                                        break;
index 123aeec7cc233eee16d95bc1bbfe1f92df9665d9..5916ca632c9c3407047be99cf6f4d6d1c043c1f8 100644 (file)
@@ -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);