From: Arto Heikkinen Date: Sun, 4 Apr 2010 07:44:15 +0000 (+0300) Subject: create_planets: Modify the for-loop to start from 0. X-Git-Url: http://git.itanic.dy.fi/?p=sdl-planets;a=commitdiff_plain;h=a0c0aa337cdcd9f6ac0ced6231ee29d2bc5923db create_planets: Modify the for-loop to start from 0. --- diff --git a/planet.c b/planet.c index c7b01a0..2b5c7f0 100644 --- 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);