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?p=pintos-anon;a=commitdiff_plain;h=83855d769a0a09dd9f2bfdd74f1b5f8a23a1bd7e 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);