From ef6f6495797a71f80dd59dade63d413c5c496ad2 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Thu, 12 Jan 2017 15:30:45 +0100 Subject: [PATCH] fix(fs): Make sure to match with correct mtab entry Fixes #321 --- src/modules/fs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/fs.cpp b/src/modules/fs.cpp index df6eb955..30e29ed4 100644 --- a/src/modules/fs.cpp +++ b/src/modules/fs.cpp @@ -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; }