From 14125803572e1fa6efb2badf4a41e2e59e81a76d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 16 Apr 2008 06:32:43 -0700 Subject: sam: clean up checkerrs (Rob Pike) --- src/cmd/sam/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd/sam') diff --git a/src/cmd/sam/shell.c b/src/cmd/sam/shell.c index 80348933..32e1b3d2 100644 --- a/src/cmd/sam/shell.c +++ b/src/cmd/sam/shell.c @@ -142,13 +142,13 @@ plan9(File *f, int type, String *s, int nest) void checkerrs(void) { - char buf[4096]; + char buf[BLOCKSIZE-10]; int f, n, nl; char *p; long l; if(statfile(errfile, 0, 0, 0, &l, 0) > 0 && l != 0){ - if((f=open((char *)errfile, 0)) != -1){ + if((f=open(errfile, 0)) != -1){ if((n=read(f, buf, sizeof buf-1)) > 0){ for(nl=0,p=buf; nl<25 && p<&buf[n]; p++) if(*p=='\n') @@ -161,5 +161,5 @@ checkerrs(void) close(f); } }else - remove((char *)errfile); + remove(errfile); } -- cgit v1.2.3