aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-06 22:58:42 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-07 08:16:53 -0700
commit3278953f861c193c9270707f8cf222c4439d9fa2 (patch)
tree89cdaebd6312069a5ad5dc2959ce75a9f3285c1a
parent53b1b17f4fc0a78397f0de500eea95612006c55d (diff)
downloadsubsurface-3278953f861c193c9270707f8cf222c4439d9fa2.tar.gz
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>
-rw-r--r--core/taxonomy.c4
1 files changed, 3 insertions, 1 deletions
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);
}