diff options
Diffstat (limited to 'libbb/match_fstype.c')
-rw-r--r-- | libbb/match_fstype.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/match_fstype.c b/libbb/match_fstype.c index 32c3d7f18..b066b4211 100644 --- a/libbb/match_fstype.c +++ b/libbb/match_fstype.c | |||
@@ -17,7 +17,6 @@ | |||
17 | int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) | 17 | int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) |
18 | { | 18 | { |
19 | int match = 1; | 19 | int match = 1; |
20 | int len; | ||
21 | 20 | ||
22 | if (!t_fstype) | 21 | if (!t_fstype) |
23 | return match; | 22 | return match; |
@@ -27,10 +26,10 @@ int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) | |||
27 | t_fstype += 2; | 26 | t_fstype += 2; |
28 | } | 27 | } |
29 | 28 | ||
30 | len = strlen(mt->mnt_type); | ||
31 | while (1) { | 29 | while (1) { |
32 | if (strncmp(mt->mnt_type, t_fstype, len) == 0 | 30 | char *after_mnt_type = is_prefixed_with(t_fstype, mt->mnt_type); |
33 | && (t_fstype[len] == '\0' || t_fstype[len] == ',') | 31 | if (after_mnt_type |
32 | && (*after_mnt_type == '\0' || *after_mnt_type == ',') | ||
34 | ) { | 33 | ) { |
35 | return match; | 34 | return match; |
36 | } | 35 | } |