Report an error when n is not equal to MAXFILE

The variable `n` represents the number of blocks that have been read.
This commit is contained in:
RayAndrew 2022-10-15 22:39:41 +08:00 committed by Frans Kaashoek
parent 72cb3849eb
commit 7687b389c2

View file

@ -609,7 +609,7 @@ writebig(char *s)
for(;;){
i = read(fd, buf, BSIZE);
if(i == 0){
if(n == MAXFILE - 1){
if(n != MAXFILE){
printf("%s: read only %d blocks from big", s, n);
exit(1);
}