From 3ece3d60f41b65470ec5ce6c9a0b830e32a84422 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 5 Apr 2010 18:06:04 +0200 Subject: rename mnl_attr_type_ok() by mnl_attr_type_valid() for consistency better to rename this function since its return value is not similar to other _ok() functions, for consistency. Signed-off-by: Pablo Neira Ayuso --- src/attr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/attr.c') diff --git a/src/attr.c b/src/attr.c index af12a47..2081bb3 100644 --- a/src/attr.c +++ b/src/attr.c @@ -99,21 +99,21 @@ struct nlattr *mnl_attr_next(const struct nlattr *attr, int *len) } /** - * mnl_attr_type_ok - check if the attribute type is valid + * mnl_attr_type_valid - check if the attribute type is valid * @attr: pointer to attribute to be checked * @max: maximum attribute type * * This function allows to check if the attribute type is higher than the * maximum supported type. If the attribute type is invalid, this function - * returns -1 and errno is explicitly set. + * returns -1 and errno is explicitly set. On success, this function returns 1. */ -int mnl_attr_type_ok(const struct nlattr *attr, int max) +int mnl_attr_type_valid(const struct nlattr *attr, int max) { if (mnl_attr_get_type(attr) > max) { errno = EINVAL; return -1; } - return 0; + return 1; } static int __mnl_attr_validate(const struct nlattr *attr, -- cgit v1.2.3