X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fhigh_scores.c;h=d84dcabf6f25020af20f936ab8d7471cc8fdd225;hb=2f395aba3974db45f45a8587ed423a3abeab4cd5;hp=6cf9ab4542c10586a93b3032cb2721de30f5d968;hpb=9d1f5cf0d4a76fcd05d7dcab156bf23ca3a01638;p=supertux.git diff --git a/src/high_scores.c b/src/high_scores.c index 6cf9ab454..d84dcabf6 100644 --- a/src/high_scores.c +++ b/src/high_scores.c @@ -19,27 +19,26 @@ FILE * opendata(char * mode) FILE * fi; -#ifdef LINUX - - /* Create the buffer for the filename: */ - filename = (char *) malloc(sizeof(char) * (strlen(st_dir) + - strlen("/highscore") + 1)); + strlen("/st_highscore.dat") + 1)); strcpy(filename, st_dir); /* Open the high score file: */ - + +#ifdef LINUX strcat(filename, "/highscore"); #else - - filename = "st_highscore.dat"; +#ifdef WIN32 + strcat(filename, "/st_highscore.dat"); + #endif #endif /* Try opening the file: */ fi = fopen(filename, mode); - + free( filename ); + if (fi == NULL) { fprintf(stderr, "Warning: I could not open the high score file ");