diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-02-25 13:58:21 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-02-25 13:58:21 +0000 |
commit | d1816967a16376be5f11542df4106e2c38385357 (patch) | |
tree | 74f48bda16c15b109351e5451eb5be77d5e55d06 /navit/osd | |
parent | 35efad49ef5cfafa31c000c64702729ba3001155 (diff) | |
download | navit-d1816967a16376be5f11542df4106e2c38385357.tar.gz |
Fix:osd_core:Prevent a crash
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2072 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/osd')
-rw-r--r-- | navit/osd/core/osd_core.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index bfaf7a675..7df3c48d3 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -890,7 +890,7 @@ osd_text_draw(struct osd_text *this, struct navit *navit, struct vehicle *v) struct point p, p2[4]; char *str,*next,*start,*end,*key,*subkey,*index,*value; int do_draw = 0; - struct attr attr, vehicle_attr, flags_attr, maxspeed_attr; + struct attr attr, vehicle_attr, maxspeed_attr; struct navigation *nav = NULL; struct tracking *tracking = NULL; struct route *route = NULL; @@ -964,11 +964,9 @@ osd_text_draw(struct osd_text *this, struct navit *navit, struct vehicle *v) item=tracking_get_current_item(tracking); if (item && !strcmp(key,"route_speed")) { double routespeed = -1; - if (item_attr_get(item, attr_flags, &flags_attr) && (flags_attr.u.num & AF_SPEED_LIMIT)) { - if (item_attr_get(item, attr_maxspeed, &maxspeed_attr)) { - routespeed = maxspeed_attr.u.num; - value = format_speed(routespeed, ""); - } + if ((tracking_get_current_flags(tracking) & AF_SPEED_LIMIT) && tracking_get_current_attr(tracking, attr_maxspeed, &maxspeed_attr)) { + routespeed = maxspeed_attr.u.num; + value = format_speed(routespeed, ""); } if ((routespeed == -1) && route && (speedlist=route_get_speedlist(route))) { |