diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index 9d3f25af1..138a0ceed 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c @@ -270,18 +270,18 @@ char *get_fstype_from_devname(const char *device) { #if ENABLE_FEATURE_BLKID_TYPE struct uuidCache_s *uc; - struct stat *statbuf; + struct stat statbuf; - if (stat(device, statbuf) < 0) + if (stat(device, &statbuf) < 0) return NULL; - if (!S_ISBLK(statbuf->st_mode) && !S_ISREG(statbuf->st_mode)) + if (!S_ISBLK(statbuf.st_mode) && !S_ISREG(statbuf.st_mode)) return NULL; add_to_uuid_cache(device); uc = uuidcache_init(0); - return uc->type; + return (char*)uc->type; #else return NULL; #endif