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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-10-06 22:58:42 -07:00
parent 53b1b17f4f
commit 3278953f86

View file

@ -78,8 +78,10 @@ void taxonomy_set_country(struct taxonomy_data *t, const char *country, enum tax
fprintf(stderr, "Error adding country taxonomy\n"); fprintf(stderr, "Error adding country taxonomy\n");
return; return;
} }
idx = ++t->nr; idx = t->nr++;
} }
t->category[idx].value = country; t->category[idx].value = country;
t->category[idx].origin = origin; t->category[idx].origin = origin;
t->category[idx].category = TC_COUNTRY;
fprintf(stderr, "%s: set the taxonomy country to %s\n", __func__, country);
} }