From a0c0aa337cdcd9f6ac0ced6231ee29d2bc5923db Mon Sep 17 00:00:00 2001 From: Arto Heikkinen Date: Sun, 4 Apr 2010 10:44:15 +0300 Subject: [PATCH] create_planets: Modify the for-loop to start from 0. --- planet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.45.0