From 000d5216763a6fc9ea24a340e764392bb2fd682b Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Thu, 23 Oct 2008 06:30:48 +0000 Subject: [PATCH] Fixed possible uninitialised variable uses --- rc.c | 8 +++++--- shared.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rc.c b/rc.c index aab2f82..ecea8a2 100644 --- a/rc.c +++ b/rc.c @@ -4433,6 +4433,9 @@ void dogravity(sprite_t *s) { int macex,macey; int numcaught = 0; + // initialise just in case + macex = s->x ; macey = s->y; + s->slamming = 0; /* reset fruit type counter */ @@ -4452,8 +4455,7 @@ void dogravity(sprite_t *s) { if (!s2) { // should never happen - macex = 0; - macey = 0; + macex = s->x ; macey = s->y; } else { int xx,yy; macex = s2->x; @@ -6004,7 +6006,7 @@ void initsdl(void) { void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) { char tempm[MIDBUFLEN]; int gotscore = fruit->score; - int modscore; + int modscore = gotscore; // default int i; /* kill the fruit */ diff --git a/shared.c b/shared.c index 1f758ad..4fdee60 100644 --- a/shared.c +++ b/shared.c @@ -30,7 +30,7 @@ int loadlevel(int wnum, int lnum, int wantmonsters) { char tempfile[BUFLEN]; char *help[MAXHELP]; int numhelp = 0; - int curhelp; + int curhelp = 0; char *p; int tileid; int i;