Fix obvious bug in ismnt() found by Coverity Scan

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-03-05 10:10:45 +01:00
parent 9167d9255d
commit 621da582c2
+5 -3
View File
@@ -563,10 +563,12 @@ int ismnt(char *file, char *dir, char *mode)
while ((mnt = getmntent(fp))) {
if (!strcmp(mnt->mnt_dir, dir)) {
if (mode && hasopt(mnt->mnt_opts, mode))
found = 1;
else
if (mode) {
if (hasopt(mnt->mnt_opts, mode))
found = 1;
} else
found = 1;
break;
}
}