]> err.no Git - util-linux/commitdiff
libblkid: fix blkid_fstatat() code
authorKarel Zak <kzak@redhat.com>
Fri, 4 Dec 2009 17:44:57 +0000 (18:44 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Dec 2009 17:44:57 +0000 (18:44 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/devno.c

index f48f26ecb83a749769fe808eebf42d1acd9583ac..7b9438ff797ec83dfc5841be8d569701ea7ae090 100644 (file)
@@ -99,8 +99,8 @@ int blkid_fstatat(DIR *dir, const char *dirname, const char *filename,
        char device[PATH_MAX];
        int len;
 
-       len = snprintf(device, sizeof(device), "%s/%s", *dirname, name);
-       if (len < 0 || len + 1 > sizeof(path))
+       len = snprintf(device, sizeof(device), "%s/%s", dirname, filename);
+       if (len < 0 || len + 1 > sizeof(device))
                return -1;
 
        return nofollow ? lstat(device, st) : stat(device, st);