From 7687b389c2332bc9c6369825ec83628bd0b01a9c Mon Sep 17 00:00:00 2001 From: RayAndrew <krayand4567@gmail.com> Date: Sat, 15 Oct 2022 22:39:41 +0800 Subject: [PATCH] Report an error when `n` is not equal to `MAXFILE` The variable `n` represents the number of blocks that have been read. --- user/usertests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/usertests.c b/user/usertests.c index 0f276b4..1beeb77 100644 --- a/user/usertests.c +++ b/user/usertests.c @@ -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); }