dumpfs(8): The device name can be longer than 12 chars due to /dev/serno.
authorSascha Wildner <saw@online.de>
Mon, 29 Mar 2010 22:09:00 +0000 (00:09 +0200)
committerSascha Wildner <saw@online.de>
Mon, 29 Mar 2010 22:09:25 +0000 (00:09 +0200)
sbin/dumpfs/dumpfs.c

index e8a254c..ad72315 100644 (file)
@@ -316,7 +316,7 @@ marshal(const char *name)
 {
        ssize_t n;
        int fd;
-       static char realname[12];
+       static char realname[PATH_MAX];
 
        if ((fd = open(name, O_RDONLY, 0)) < 0)
                goto err;
@@ -338,9 +338,9 @@ marshal(const char *name)
        }
 
        if(strncmp(name, "/dev", 4) == 0) {
-               snprintf(realname, 12, "%s", name);
+               snprintf(realname, PATH_MAX, "%s", name);
        } else {
-               snprintf(realname, 12, "/dev/%s", name);
+               snprintf(realname, PATH_MAX, "/dev/%s", name);
        }
 
        printf("# newfs command for %s (%s)\n", name, realname);