From ab6f1aeac761178fb70863681eab9e681aa3f379 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Tue, 31 May 2016 11:23:30 +0200 Subject: 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 --- src/cmd/cb/cb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd/cb') 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); -- cgit v1.2.3 From fa325e9b42b0bdfb48857d1958d9fb7ceac55151 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Fri, 10 Jan 2020 14:44:21 +0000 Subject: Trivial changes: whitespace and modes. Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross --- src/cmd/cb/cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/cb') diff --git a/src/cmd/cb/cb.c b/src/cmd/cb/cb.c index 9e611f04..ebca5cc5 100644 --- a/src/cmd/cb/cb.c +++ b/src/cmd/cb/cb.c @@ -1007,7 +1007,7 @@ clearif(struct indent *cl) int i; for(i=0;iifc[i] = 0; } -char +char puttmp(char c, int keep) { if(tp < &temp[TEMP-120]) -- cgit v1.2.3