libblkid: fix blkid_fstatat() code

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2009-12-04 18:44:57 +01:00
parent d7a0158242
commit fc31c7e5b2
1 changed files with 2 additions and 2 deletions

View 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);