ed: fix bugs and warnings
authorAlan Cox <alan@linux.intel.com>
Sun, 21 May 2017 21:50:28 +0000 (22:50 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 21 May 2017 21:50:28 +0000 (22:50 +0100)
With this fixed it seems to be stable on M68K.

Applications/util/ed.c

index 9ad4bb1..c33dd5f 100644 (file)
@@ -134,7 +134,7 @@ static void docommands(void)
 
        cp = buf;
        while (isblank(*cp))
-           *cp++;
+           cp++;
 
        have1 = FALSE;
        have2 = FALSE;
@@ -468,7 +468,7 @@ static void subcommand(char *cp, NUM num1, NUM num2)
                printlines(num1, num1, FALSE);
                needprint = FALSE;
            }
-           lp = nlp->next;
+           lp = lp->next;
            num1++;
            continue;
        }
@@ -926,7 +926,7 @@ static BOOL printlines(NUM num1, NUM num2, BOOL expandflag)
         * Show control characters and characters with the
         * high bit set specially.
         */
-       cp = lp->data;
+       cp = (unsigned char *)lp->data;
        count = lp->len;
        if ((count > 0) && (cp[count - 1] == '\n'))
            count--;