From: Karel Zak Date: Fri, 4 Dec 2009 17:44:57 +0000 (+0100) Subject: libblkid: fix blkid_fstatat() code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc31c7e5b2a2019f64287ad38678e7442053c0d9;p=util-linux libblkid: fix blkid_fstatat() code Signed-off-by: Karel Zak --- 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);