Fixed a buffer overrun in the skin reading... make saving the config work again...

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@719 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2009-04-04 18:41:04 +00:00
parent 8b29381699
commit be1da7b6a6
4 changed files with 14 additions and 10 deletions

View File

@ -22,6 +22,8 @@
#ifndef __BOUTONS_H_ #ifndef __BOUTONS_H_
#define __BOUTONS_H_ #define __BOUTONS_H_
#include "struct.h"
/*! /*!
Displays an error message when calling an unavailable function. Displays an error message when calling an unavailable function.
Only used in the beta versions for things we haven't coded yet. Only used in the beta versions for things we haven't coded yet.

4
init.c
View File

@ -230,8 +230,8 @@ void Center_GUI_cursor(byte *cursor_buffer, int cursor_number)
Cursor_offset_X[cursor_number]=14-start_x; Cursor_offset_X[cursor_number]=14-start_x;
Cursor_offset_Y[cursor_number]=14-start_y; Cursor_offset_Y[cursor_number]=14-start_y;
for (y=0;y<29;y++) for (y=0;y<CURSOR_SPRITE_HEIGHT;y++)
for (x=0;x<29;x++) for (x=0;x<CURSOR_SPRITE_WIDTH;x++)
GFX_cursor_sprite[cursor_number][y][x]=cursor_buffer[(start_y+y)*29+start_x+x]; GFX_cursor_sprite[cursor_number][y][x]=cursor_buffer[(start_y+y)*29+start_x+x];
} }

View File

@ -32,18 +32,19 @@
#include <png.h> #include <png.h>
#endif #endif
#include "const.h"
#include "struct.h"
#include "global.h"
#include "misc.h"
#include "pages.h"
#include "op_c.h"
#include "buttons.h" #include "buttons.h"
#include "const.h"
#include "errors.h" #include "errors.h"
#include "global.h"
#include "io.h" #include "io.h"
#include "sdlscreen.h"
#include "windows.h"
#include "loadsave.h" #include "loadsave.h"
#include "misc.h"
#include "op_c.h"
#include "pages.h"
#include "palette.h"
#include "sdlscreen.h"
#include "struct.h"
#include "windows.h"
// -- PKM ------------------------------------------------------------------- // -- PKM -------------------------------------------------------------------
void Test_PKM(void); void Test_PKM(void);

1
main.c
View File

@ -646,6 +646,7 @@ void Program_shutdown(void)
free(Main_screen); free(Main_screen);
// On prend bien soin de passer dans le répertoire initial: // On prend bien soin de passer dans le répertoire initial:
DEBUG(Initial_directory,1);
if (chdir(Initial_directory)!=-1) if (chdir(Initial_directory)!=-1)
{ {
// On sauvegarde les données dans le .CFG et dans le .INI // On sauvegarde les données dans le .CFG et dans le .INI