From 812456503eb4018219bf3641cd525d7b63883a0c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 11 Jun 2014 19:10:01 +0200 Subject: 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 --- src/common.c | 14 +++++++------- 1 file 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); -- cgit v1.2.3