libblkid: fix blkid_fstatat() code
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
d7a0158242
commit
fc31c7e5b2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue