X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/a68924a6e07d69bc4b8d6106b3af0ac5a7490905..1bbf66cfa8d4bce84261143b05ad0a438067e71d:/usr/src/cmd/pr.c diff --git a/usr/src/cmd/pr.c b/usr/src/cmd/pr.c index ced0dc89fa..880661e8be 100644 --- a/usr/src/cmd/pr.c +++ b/usr/src/cmd/pr.c @@ -159,7 +159,7 @@ char **argp; mopen(argp); ncol = nofile; } - colw = width/ncol; + colw = width/(ncol==0? 1 : ncol); sncol = ncol; sheader = header; plength = length-5; @@ -288,8 +288,7 @@ nexbuf() n = &buffer[BUFS] - rbufp; if (n>512) n = 512; - if(feof(file) || - (n=fread(rbufp,1,n,file)) <= 0){ + if((n=fread(rbufp,1,n,file)) <= 0){ fclose(file); *rbufp = 0376; }