From: Ben Pfaff Date: Sun, 10 May 2020 15:57:52 +0000 (+0000) Subject: fsutil: Fix writing end-of-archive marker. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b159cecc50ea853bcfc7c9c45dfa437fbef66b4;p=pintos-anon fsutil: Fix writing end-of-archive marker. This code was supposed to write two sectors but instead it wrote the same sector twice. Thanks to Grant A Shurtz for reporting this bug. --- diff --git a/src/filesys/fsutil.c b/src/filesys/fsutil.c index 5f045d6..df632df 100644 --- a/src/filesys/fsutil.c +++ b/src/filesys/fsutil.c @@ -215,7 +215,7 @@ fsutil_append (char **argv) them, though, in case we have more files to append. */ memset (buffer, 0, BLOCK_SECTOR_SIZE); block_write (dst, sector, buffer); - block_write (dst, sector, buffer + 1); + block_write (dst, sector + 1, buffer); /* Finish up. */ file_close (src);