summaryrefslogtreecommitdiff
path: root/navit/osd
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-02-25 13:58:21 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-02-25 13:58:21 +0000
commitd1816967a16376be5f11542df4106e2c38385357 (patch)
tree74f48bda16c15b109351e5451eb5be77d5e55d06 /navit/osd
parent35efad49ef5cfafa31c000c64702729ba3001155 (diff)
downloadnavit-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.c10
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))) {