From 3278953f861c193c9270707f8cf222c4439d9fa2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 6 Oct 2017 22:58:42 -0700 Subject: Fix two bugs in taxonomy_set_country The random coincidence that this code actually ended up working in my tests is weird. Signed-off-by: Dirk Hohndel --- core/taxonomy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/taxonomy.c b/core/taxonomy.c index 8776862d6..1689d1952 100644 --- a/core/taxonomy.c +++ b/core/taxonomy.c @@ -78,8 +78,10 @@ void taxonomy_set_country(struct taxonomy_data *t, const char *country, enum tax fprintf(stderr, "Error adding country taxonomy\n"); return; } - idx = ++t->nr; + idx = t->nr++; } t->category[idx].value = country; t->category[idx].origin = origin; + t->category[idx].category = TC_COUNTRY; + fprintf(stderr, "%s: set the taxonomy country to %s\n", __func__, country); } -- cgit v1.2.3-70-g09d2