]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Fix minor bug in mkfs, causes compilation error on release mode
authorDavid Devecsery <ddevec@gatech.edu>
Fri, 28 Aug 2020 13:20:09 +0000 (09:20 -0400)
committerDavid Devecsery <ddevec@gatech.edu>
Fri, 28 Aug 2020 13:20:09 +0000 (09:20 -0400)
tools/mkfs.c

index 753f49c5bc034d31847201fc09bf0a68d8bfb359..16b505b1c880267668206cf115f1a29f7ccfa888 100644 (file)
@@ -153,7 +153,7 @@ main(int argc, char *argv[])
 
     bzero(&de, sizeof(de));
     de.inum = xshort(inum);
-    strncpy(de.name, argv[i], DIRSIZ);
+    strncpy(de.name, argv[i], DIRSIZ-1);
     iappend(rootino, &de, sizeof(de));
 
     while((cc = read(fd, buf, sizeof(buf))) > 0)