Hi,
I've writing a small game, and as an update to it I'm learning how to use memblocks to store an image which I can then query information from.
The code attached load an image, then sets it as a memblock and also sets up a char variable which will eventially display the message.
I've stripped out all other code to narrow down the error.
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode ( 600 , 600 , 32 );
dbLoadImage ("environment1.png" ,4);
dbMakeMemblockFromBitmap ( 8, 4 );
char message[200];
while ( LoopGDK ( ) )
{
strcpy (message, ""); // blanks the message buffer
dbSync ( );
}
return;
}
The variable message is blanked on each cycle of the while loop, it is will then be filled with a text message and display on each pass. (I've stripped this bit out)
Why does this cause a buffer overflow??
Thanks for any help.