Mail Archives: djgpp/1999/05/19/06:18:56
In article <19990519053901232 DOT AAA56 DOT 87 AT mike-s-toy> you wrote:
You have a fundamental bug in your program. Had you tried to really
trim it down to the absolute minimum, throwing away everything that
doesn't directly seem to be part of the bug itself, you might have
found it yourself.
[...]
> for(i=0;i<=200;i++)
> {
> ScreenClip.Start[i]=0;ScreenClip.End[i]=320;
> }
By removing this block of code, you would have removed the bug. The actual
problem is that '<=200' in the loop end condition. You're accessing Element
ScreenClip.Start[200], which does not exist (only elementes [0] to [199] do).
This write past the end of ScreenClip hits the beginning of 'Hex' in memory,
and destroys Hex.Vert[0]
As a side note: you have a number of completely superfluous casts in
your code. They're do nothing, except cluttering the source code, so
you might just as well remove them.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -