cb: fix a null pointer dereference

Just added a pair of parentheses. I also ran cb on cb.c to beautify the
code.

This is actually on Gerrit from 2016:
https://plan9port-review.googlesource.com/c/plan9/+/1574

Change-Id: I5e234adba0f95c13d6eecb121bf11bba4bf54566
This commit is contained in:
Neven Sajko 2016-05-31 11:23:30 +02:00 committed by David du Colombier
parent a1ead676e6
commit ab6f1aeac7

View file

@ -29,7 +29,7 @@ main(int argc, char *argv[])
maxleng -= (maxleng + 5)/10;
continue;
default:
fprint(2, "cb: illegal option %c\n", *argv[1]);
fprint(2, "cb: illegal option %c\n", (*argv)[1]);
exits("boom");
}
}
@ -969,7 +969,7 @@ cont:
if(nlct++ > 2)goto done;
}
puttmp(c,1);
star:
star:
if(puttmp((c=Bgetc(input)),1) == '/'){
beg = tp;
puttmp((c=Bgetc(input)),1);