From be1da7b6a69571caab8c7026391bdf3b215f6b54 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 4 Apr 2009 18:41:04 +0000 Subject: [PATCH] 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 --- buttons.h | 2 ++ init.c | 4 ++-- loadsave.c | 17 +++++++++-------- main.c | 1 + 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/buttons.h b/buttons.h index 81ba4eea..94cb74b5 100644 --- a/buttons.h +++ b/buttons.h @@ -22,6 +22,8 @@ #ifndef __BOUTONS_H_ #define __BOUTONS_H_ +#include "struct.h" + /*! Displays an error message when calling an unavailable function. Only used in the beta versions for things we haven't coded yet. diff --git a/init.c b/init.c index 3ad5366b..37c8cc29 100644 --- a/init.c +++ b/init.c @@ -230,8 +230,8 @@ void Center_GUI_cursor(byte *cursor_buffer, int cursor_number) Cursor_offset_X[cursor_number]=14-start_x; Cursor_offset_Y[cursor_number]=14-start_y; - for (y=0;y<29;y++) - for (x=0;x<29;x++) + for (y=0;y #endif -#include "const.h" -#include "struct.h" -#include "global.h" -#include "misc.h" -#include "pages.h" -#include "op_c.h" #include "buttons.h" +#include "const.h" #include "errors.h" +#include "global.h" #include "io.h" -#include "sdlscreen.h" -#include "windows.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 ------------------------------------------------------------------- void Test_PKM(void); diff --git a/main.c b/main.c index 4ee61083..85613f3a 100644 --- a/main.c +++ b/main.c @@ -646,6 +646,7 @@ void Program_shutdown(void) free(Main_screen); // On prend bien soin de passer dans le répertoire initial: + DEBUG(Initial_directory,1); if (chdir(Initial_directory)!=-1) { // On sauvegarde les données dans le .CFG et dans le .INI