if (statvfs(path, &buf) == -1) {
/* If statvfs errors, e.g., due to the path not existing,
* we use the format for a not mounted device. */
- format = format_not_mounted;
+ if (format_not_mounted != NULL) {
+ format = format_not_mounted;
+ }
} else if (format_not_mounted != NULL) {
FILE *mntentfile = setmntent("/etc/mtab", "r");
struct mntent *m;