]> git.itanic.dy.fi Git - sdl-planets/commitdiff
create_planets: Modify the for-loop to start from 0.
authorArto Heikkinen <artoheik@ee.oulu.fi>
Sun, 4 Apr 2010 07:44:15 +0000 (10:44 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 4 Apr 2010 08:35:22 +0000 (11:35 +0300)
planet.c

index c7b01a05995f91442d0c550df6e259a49c4e2dc4..2b5c7f09217c6726b6c99c98e63fea26e7d288e7 100644 (file)
--- a/planet.c
+++ b/planet.c
@@ -73,7 +73,7 @@ void create_planets(struct planet *p, int num, double total_mass, double radius)
        double sum = 0;
        struct planet *new_planet;
 
-       for (i = 1; i < num; i++) {
+       for (i = 0; i < num; i++) {
                new_planet = malloc(sizeof(*new_planet));
                init_planet(new_planet);
                list_add(&new_planet->list, &p->list);