diff options
author | Neven Sajko <nsajko@gmail.com> | 2016-05-31 11:23:30 +0200 |
---|---|---|
committer | David du Colombier <0intro@gmail.com> | 2020-01-02 16:16:41 +0100 |
commit | ab6f1aeac761178fb70863681eab9e681aa3f379 (patch) | |
tree | 2609677d607413f824c2ae6d01aa31f385714d93 /src/cmd/cb | |
parent | a1ead676e69d46df89dd0de12cf86380c5773353 (diff) | |
download | plan9port-ab6f1aeac761178fb70863681eab9e681aa3f379.tar.gz plan9port-ab6f1aeac761178fb70863681eab9e681aa3f379.tar.bz2 plan9port-ab6f1aeac761178fb70863681eab9e681aa3f379.zip |
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
Diffstat (limited to 'src/cmd/cb')
-rw-r--r-- | src/cmd/cb/cb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/cb/cb.c b/src/cmd/cb/cb.c index 0b245896..9e611f04 100644 --- a/src/cmd/cb/cb.c +++ b/src/cmd/cb/cb.c @@ -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"); } } @@ -354,7 +354,7 @@ work(void){ continue; } } - else if (lbegin == 0 || p > string) + else if (lbegin == 0 || p > string) if(strict) putch(c,NO); else putch(c,YES); @@ -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); |