summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-10 12:26:35 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-10 12:26:35 +0000
commit3f8820318302da097795ba7d8b2ae3f6dff6cf2e (patch)
treee0d8846a216c4a2a5f303813abc5878f3384b127 /src
parent488196551e5e34af3df5d92358f3efa5a08f5730 (diff)
parent4097ad726fce2398b42795d7b316d39fb8ea6ee5 (diff)
Merge remote-tracking branch 'origin/master' into next-3.14
Diffstat (limited to 'src')
-rw-r--r--src/datatype.c7
-rw-r--r--src/erec.c3
-rw-r--r--src/main.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/datatype.c b/src/datatype.c
index fdcec8d1..e228f530 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -248,10 +248,8 @@ static struct error_record *integer_type_parse(const struct expr *sym,
if (gmp_sscanf(sym->identifier, "%Zu%n", v, &len) != 1 ||
(int)strlen(sym->identifier) != len) {
mpz_clear(v);
- if (sym->dtype != &integer_type) {
- return error(&sym->location, "This is not a valid %s",
- sym->dtype->desc);
- }
+ if (sym->dtype != &integer_type)
+ return NULL;
return error(&sym->location, "Could not parse %s",
sym->dtype->desc);
}
@@ -663,6 +661,7 @@ static struct error_record *mark_type_parse(const struct expr *sym,
}
}
+ *res = NULL;
erec = sym->dtype->basetype->parse(sym, res);
if (erec != NULL)
return erec;
diff --git a/src/erec.c b/src/erec.c
index 7451d94c..a157d2fa 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -138,7 +138,8 @@ void erec_print(FILE *f, const struct error_record *erec)
end = 0;
for (l = erec->num_locations - 1; l >= 0; l--) {
loc = &erec->locations[l];
- for (i = loc->first_column - 1; i < loc->last_column; i++)
+ for (i = loc->first_column ? loc->first_column - 1 : 0;
+ i < loc->last_column; i++)
buf[i] = l ? '~' : '^';
end = max(end, loc->last_column);
}
diff --git a/src/main.c b/src/main.c
index 33a02e1a..14152398 100644
--- a/src/main.c
+++ b/src/main.c
@@ -187,8 +187,8 @@ static int nft_netlink(struct parser_state *state, struct list_head *msgs)
if (err->seqnum == cmd->seqnum ||
err->seqnum == batch_seqnum) {
netlink_io_error(&ctx, &cmd->location,
- "Could not process rule in batch: %s",
- strerror(err->err));
+ "Could not process rule: %s",
+ strerror(err->err));
if (err->seqnum == cmd->seqnum) {
mnl_err_list_free(err);
break;