diff --git a/src/modal.c b/src/modal.c index 34d2800..af6e1f8 100644 --- a/src/modal.c +++ b/src/modal.c @@ -25,7 +25,7 @@ walk(char *s) if(!depth) return s; } } - while(!spacer(s[0]) && (c = *s++)) + while(!spacer(s[0]) && *s++) ; return s; } @@ -122,20 +122,17 @@ commit(char r, char *incoming) } static int -save(int rule, char *p) +save(int rule, char *s) { - while((*outp_++ = *p++)) + while((*outp_++ = *s++)) ; *outp_++ = 0; if((direction = !direction)) prog_ = bank_b, outp_ = bank_a; else prog_ = bank_a, outp_ = bank_b; - if(rule >= 0) { - char *program = direction ? bank_b : bank_a; - while(program[1] && program[0] < 0x21) program++; - fprintf(stderr, "%02d %s\n", rule, program); - } + if(rule >= 0) + fprintf(stderr, "%02d %s\n", rule, prog_); return 1; } @@ -170,7 +167,7 @@ static int rewrite(char *incoming) { char c, *p = direction ? bank_b : bank_a; - while(*p == 0xa || *p == ' ') p++; + while((c = *p) && c <= ' ') p++; while((c = *p)) { int i; if(p[0] == '<' && p[1] == '>') {