fix(fs): Make sure to match with correct mtab entry

Fixes #321
This commit is contained in:
Michael Carlberg 2017-01-12 15:30:45 +01:00
parent 5773b08cf8
commit ef6f649579

View File

@ -77,7 +77,9 @@ namespace modules {
auto& mount = m_mounts.back();
while (mtab->next(&mnt)) {
if (strncmp(mnt->mnt_dir, mountpoint.c_str(), strlen(mnt->mnt_dir)) != 0) {
if (strlen(mnt->mnt_dir) != mountpoint.size()) {
continue;
} else if (strncmp(mnt->mnt_dir, mountpoint.c_str(), mountpoint.size()) != 0) {
continue;
}