diff --git a/io.c b/io.c index b03150d2..b3c29511 100644 --- a/io.c +++ b/io.c @@ -194,9 +194,9 @@ void Extract_filename(char *dest, const char *source) // Récupère la partie "répertoire+/" d'un chemin. void Extract_path(char *dest, const char *source) { - char * position; + char * position=NULL; - strcpy(dest,source); + realpath(source,dest); position = Find_last_slash(dest); if (position) *(position+1) = '\0'; diff --git a/text.c b/text.c index f69060c3..500d5f66 100644 --- a/text.c +++ b/text.c @@ -55,6 +55,7 @@ #include "global.h" #include "sdlscreen.h" #include "io.h" +#include "errors.h" typedef struct T_Font { @@ -459,10 +460,14 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh // Chargement de la fonte Surface_fonte=IMG_Load(Font_name(font_number)); if (!Surface_fonte) + { + DEBUG("Font loading failed",0); return NULL; + } font=SFont_InitFont(Surface_fonte); if (!font) { + DEBUG("Font init failed",1); return NULL; } @@ -475,6 +480,7 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh SFont_Write(TexteColore, font, 0, 0, str); if (!TexteColore) { + DEBUG("Rendering failed",2); SFont_FreeFont(font); return NULL; } @@ -485,6 +491,7 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh new_brush=Surface_to_bytefield(Texte8Bit, NULL); if (!new_brush) { + DEBUG("Converting failed",3); SDL_FreeSurface(TexteColore); SDL_FreeSurface(Texte8Bit); SFont_FreeFont(font);