delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/26/12:00:50

Date: Sat, 26 Jul 1997 09:00:31 -0700 (PDT)
Message-Id: <199707261600.JAA29584@adit.ap.net>
Mime-Version: 1.0
To: kwe1 AT flash DOT net
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: HELP! Unidentifiable bug in code
Cc: djgpp AT delorie DOT com

You wrote:
>void setpalzero ()
>{
>   int i;
>   COLOR *temp;
>   for (i = 0; i < 256; i++)
>      temp[i].red = temp[i].gre = temp[i].blu = 0;
temp is an unitialized pointer here. You are writing to god-knows-where. Try
making it an array.
>
>   SlamPal (temp);
>}
>[main function deleted]
I saw the same idea used elsewhere in the code. You have COLOR pointers
which you are using as palettes, but they don't actually point to any
storage. They aren't necessarily NULL either, so allowing that might not help.
HTH

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019