Bell 32V release
[unix-history] / usr / src / cmd / pr.c
index ced0dc8..880661e 100644 (file)
@@ -159,7 +159,7 @@ char **argp;
                mopen(argp);
                ncol = nofile;
        }
                mopen(argp);
                ncol = nofile;
        }
-       colw = width/ncol;
+       colw = width/(ncol==0? 1 : ncol);
        sncol = ncol;
        sheader = header;
        plength = length-5;
        sncol = ncol;
        sheader = header;
        plength = length-5;
@@ -288,8 +288,7 @@ nexbuf()
        n = &buffer[BUFS] - rbufp;
        if (n>512)
                n = 512;
        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;
        }
                fclose(file);
                *rbufp = 0376;
        }