]> git.street.me.uk Git - andy/viking.git/commitdiff
bugfix (thanks Christoph Eckert)
authorChristoph Eckert <ce@christeck.de>
Tue, 15 Jan 2008 03:49:59 +0000 (03:49 +0000)
committerChristoph Eckert <ce@christeck.de>
Tue, 15 Jan 2008 03:49:59 +0000 (03:49 +0000)
src/viktrwlayer.c

index e6306847faa5769cbfb855e6ed0e9f56cacfae43..570e6bf29dc8c20a204a0dd8d89b1468609a9658 100644 (file)
@@ -3847,7 +3847,7 @@ static void highest_wp_number_remove_wp(VikTrwLayer *vtl, const gchar *old_wp_na
     g_snprintf(buf,4,"%03d", vtl->highest_wp_number );
     /* search down until we find something that *does* exist */
 
-    while ( vtl->highest_wp_number >= 0 && ! g_hash_table_lookup ( vtl->waypoints, buf ) ) {
+    while ( vtl->highest_wp_number > 0 && ! g_hash_table_lookup ( vtl->waypoints, buf ) ) {
       vtl->highest_wp_number --;
       g_snprintf(buf,4,"%03d", vtl->highest_wp_number );
     }
@@ -3859,7 +3859,7 @@ static gchar *highest_wp_number_get(VikTrwLayer *vtl)
 {
   gchar buf[4];
   if ( vtl->highest_wp_number < 0 || vtl->highest_wp_number >= 999 )
-    return "";
+    return NULL;
   g_snprintf(buf,4,"%03d", vtl->highest_wp_number+1 );
   return g_strdup(buf);
 }