summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-06-11 19:10:01 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2014-06-11 19:14:29 +0200
commit812456503eb4018219bf3641cd525d7b63883a0c (patch)
tree3e7fe8618a6db4eadd771ce0931b680e26fc7040
parente4e89ef3b7a84bd80a4b373220f09a70954d8cd3 (diff)
common: homogeneous error message in nft_parse_perror()
The user-specified message should be used even if the error type is unspecified. Moreover, make the output error message homogeneous. Sometimes is was including a space before the ':' separator. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/common.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common.c b/src/common.c
index 52e5f0e..1b600f1 100644
--- a/src/common.c
+++ b/src/common.c
@@ -49,20 +49,20 @@ void nft_parse_err_free(struct nft_parse_err *err)
}
EXPORT_SYMBOL(nft_parse_err_free);
-int nft_parse_perror(const char *str, struct nft_parse_err *err)
+int nft_parse_perror(const char *msg, struct nft_parse_err *err)
{
switch (err->error) {
case NFT_PARSE_EBADINPUT:
- return fprintf(stderr, "%s : Bad input format in line %d column %d\n",
- str, err->line, err->column);
+ return fprintf(stderr, "%s: Bad input format in line %d column %d\n",
+ msg, err->line, err->column);
case NFT_PARSE_EMISSINGNODE:
- return fprintf(stderr, "%s : Node \"%s\" not found\n",
- str, err->node_name);
+ return fprintf(stderr, "%s: Node \"%s\" not found\n",
+ msg, err->node_name);
case NFT_PARSE_EBADTYPE:
return fprintf(stderr, "%s: Invalid type in node \"%s\"\n",
- str, err->node_name);
+ msg, err->node_name);
default:
- return fprintf(stderr, "Undefined error\n");
+ return fprintf(stderr, "%s: Undefined error\n", msg);
}
}
EXPORT_SYMBOL(nft_parse_perror);