diff options
author | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-05-08 19:48:12 +0000 |
---|---|---|
committer | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-05-08 19:48:12 +0000 |
commit | 77005bf1926618e7bed0c1f6af03fa6c3a4d00dd (patch) | |
tree | 175bf5a4f8e2bbf36b0308de2deb8eaa20c9cbf8 /navit/search.c | |
parent | 3a83627d0a26eb9fec96357e0b06e9df17ac2e12 (diff) | |
download | navit-svn-77005bf1926618e7bed0c1f6af03fa6c3a4d00dd.tar.gz |
Fix:core: first test the counter, than make the possible mem access
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4471 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/search.c')
-rw-r--r-- | navit/search.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/navit/search.c b/navit/search.c index 0fc584ab..ae661123 100644 --- a/navit/search.c +++ b/navit/search.c @@ -467,7 +467,7 @@ search_house_number_coordinate(struct item *item, struct interpolation *inter) hn_distance=distance_sum*hn_pos/hn_length; dbg(1,"hn_distance=%d\n",hn_distance); i=0; - while (hn_distance > distances[i] && i < count-1) + while (i < count-1 && hn_distance > distances[i]) hn_distance-=distances[i++]; dbg(1,"remaining distance=%d from %d\n",hn_distance,distances[i]); ret->x=(c[i+1].x-c[i].x)*hn_distance/distances[i]+c[i].x; |