From fc31c7e5b2a2019f64287ad38678e7442053c0d9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Dec 2009 18:44:57 +0100 Subject: [PATCH] libblkid: fix blkid_fstatat() code Signed-off-by: Karel Zak --- shlibs/blkid/src/devno.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shlibs/blkid/src/devno.c b/shlibs/blkid/src/devno.c index f48f26ec..7b9438ff 100644 --- a/shlibs/blkid/src/devno.c +++ b/shlibs/blkid/src/devno.c @@ -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); -- 2.39.5