From ba2bdf41c436640286df40529cddede46b3ba5d8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Dec 2012 14:22:39 +0100 Subject: libmount: clean nonnull attribute usage - use __attribute__((nonnull) for functions where we not able to return an return code ("is", "has" and some "get" functions). - use __attribute__((nonnull) for small functions where we always modify any of the function argument (some mnt_optstr_* functions) Signed-off-by: Karel Zak --- libmount/src/tab_parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libmount/src/tab_parse.c') diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c index 8a9d7349e..56da8ec47 100644 --- a/libmount/src/tab_parse.c +++ b/libmount/src/tab_parse.c @@ -791,7 +791,8 @@ struct libmnt_table *mnt_new_table_from_dir(const char *dirname) int mnt_table_set_parser_errcb(struct libmnt_table *tb, int (*cb)(struct libmnt_table *tb, const char *filename, int line)) { - assert(tb); + if (!tb) + return -EINVAL; tb->errcb = cb; return 0; } @@ -804,7 +805,8 @@ int mnt_table_set_parser_fltrcb(struct libmnt_table *tb, int (*cb)(struct libmnt_fs *, void *), void *data) { - assert(tb); + if (!tb) + return -EINVAL; DBG(TAB, mnt_debug_h(tb, "%s table parser filter", cb ? "set" : "unset")); tb->fltrcb = cb; -- cgit v1.2.3-55-g7522