summaryrefslogtreecommitdiff
path: root/navit/popup.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-23 06:33:44 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-23 06:33:44 +0000
commit6630bfcabb0af20273d743b2448817f39efce0e1 (patch)
tree9a69c253473079bfd1e322c1a87c20a084e6e993 /navit/popup.c
parentc7b50ff5140bfcd22d6a7815df4ac214a14da4af (diff)
downloadnavit-6630bfcabb0af20273d743b2448817f39efce0e1.tar.gz
Refactor:gui/gtk:Do not reuse variable.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5445 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/popup.c')
-rw-r--r--navit/popup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/navit/popup.c b/navit/popup.c
index 168558925..63726b80e 100644
--- a/navit/popup.c
+++ b/navit/popup.c
@@ -140,17 +140,17 @@ popup_set_visitbefore(struct navit *nav, struct pcoord *pc,int visitbefore)
{
struct pcoord *dst;
char buffer[1024];
- int i, dstcount;
+ int i, dstcount_new;
sprintf(buffer, _("Waypoint %d"), visitbefore+1);
- dstcount=navit_get_destination_count(nav)+1;
- dst=g_alloca(dstcount*sizeof(struct pcoord));
- dstcount=navit_get_destinations(nav,dst,dstcount);
- for (i=dstcount;i>visitbefore;i--){
+ dstcount_new=navit_get_destination_count(nav)+1;
+ dst=g_alloca(dstcount_new*sizeof(struct pcoord));
+ navit_get_destinations(nav,dst,dstcount_new);
+ for (i=dstcount_new-1;i>visitbefore;i--){
dst[i]=dst[i-1];
}
dst[visitbefore]=*pc;
navit_add_destination_description(nav,pc,buffer);
- navit_set_destinations(nav, dst, dstcount+1, buffer, 1);
+ navit_set_destinations(nav, dst, dstcount_new, buffer, 1);
}