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:
parent
a1ead676e6
commit
ab6f1aeac7
1 changed files with 3 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ main(int argc, char *argv[])
|
||||||
maxleng -= (maxleng + 5)/10;
|
maxleng -= (maxleng + 5)/10;
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
fprint(2, "cb: illegal option %c\n", *argv[1]);
|
fprint(2, "cb: illegal option %c\n", (*argv)[1]);
|
||||||
exits("boom");
|
exits("boom");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -354,7 +354,7 @@ work(void){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lbegin == 0 || p > string)
|
else if (lbegin == 0 || p > string)
|
||||||
if(strict)
|
if(strict)
|
||||||
putch(c,NO);
|
putch(c,NO);
|
||||||
else putch(c,YES);
|
else putch(c,YES);
|
||||||
|
|
@ -969,7 +969,7 @@ cont:
|
||||||
if(nlct++ > 2)goto done;
|
if(nlct++ > 2)goto done;
|
||||||
}
|
}
|
||||||
puttmp(c,1);
|
puttmp(c,1);
|
||||||
star:
|
star:
|
||||||
if(puttmp((c=Bgetc(input)),1) == '/'){
|
if(puttmp((c=Bgetc(input)),1) == '/'){
|
||||||
beg = tp;
|
beg = tp;
|
||||||
puttmp((c=Bgetc(input)),1);
|
puttmp((c=Bgetc(input)),1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue