From 1734f82c2435c35a9b575297a93942cf880b5913 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 11 Mar 2011 13:57:14 +0100 Subject: libmount: keep code more readable for analyzers [coverity scan] This is not a bug ('ent' is always non-NULL is 'm' is non-NULL), but let's keep static analyzes and humans who read the code happy. Signed-off-by: Karel Zak --- shlibs/mount/src/optstr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shlibs/mount/src/optstr.c') diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c index 92abcdb1a..406afc4b7 100644 --- a/shlibs/mount/src/optstr.c +++ b/shlibs/mount/src/optstr.c @@ -476,19 +476,19 @@ int mnt_split_optstr(const char *optstr, char **user, char **vfs, while(!mnt_optstr_next_option(&str, &name, &namesz, &val, &valsz)) { int rc = 0; - const struct libmnt_optmap *ent; + const struct libmnt_optmap *ent = NULL; const struct libmnt_optmap *m = mnt_optmap_get_entry(maps, 2, name, namesz, &ent); if (ent && !ent->id) continue; /* ignore undefined options (comments) */ - if (m && m == maps[0] && vfs) { + if (ent && m && m == maps[0] && vfs) { if (ignore_vfs && (ent->mask & ignore_vfs)) continue; rc = __mnt_optstr_append_option(vfs, name, namesz, val, valsz); - } else if (m && m == maps[1] && user) { + } else if (ent && m && m == maps[1] && user) { if (ignore_user && (ent->mask & ignore_user)) continue; rc = __mnt_optstr_append_option(user, name, namesz, -- cgit v1.2.3-55-g7522