diff options
author | mvglasow <michael -at- vonglasow.com> | 2019-08-11 17:36:36 +0200 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2019-08-11 17:36:36 +0200 |
commit | 704459ab0774ac1a6fe74284896be76527b534a2 (patch) | |
tree | e4b6bf806e3b6b4aece28f33feb164a656820735 | |
parent | 9d014383b742c738ef43899351a2c66b5633ac1e (diff) | |
download | navit-704459ab0774ac1a6fe74284896be76527b534a2.tar.gz |
Fix:traffic:Write cached flags so they will parse without warnings
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r-- | navit/traffic.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/navit/traffic.c b/navit/traffic.c index 99ffde167..7ebfeaaec 100644 --- a/navit/traffic.c +++ b/navit/traffic.c @@ -758,10 +758,15 @@ static void tm_item_dump_to_file(struct item * item, FILE * f) { fprintf(f, "type=%s", item_to_name(item->type)); fprintf(f, " id=0x%x,0x%x", item->id_hi, item->id_lo); while (*attrs) { - attr_text = attr_to_text(*attrs, NULL, 0); - /* FIXME this may not work properly for all attribute types */ - fprintf(f, " %s=%s", attr_to_name((*attrs)->type), attr_text); - g_free(attr_text); + if ((*attrs)->type == attr_flags) { + /* special handling for flags */ + fprintf(f, " flags=0x%x", (*attrs)->u.num); + } else { + attr_text = attr_to_text(*attrs, NULL, 0); + /* FIXME this may not work properly for all attribute types */ + fprintf(f, " %s=%s", attr_to_name((*attrs)->type), attr_text); + g_free(attr_text); + } attrs++; } fprintf(f, "\n"); |