Fix naming of savegames from files with no .

This commit is contained in:
Jeffrey Pfau 2014-07-18 00:53:08 -07:00
parent 5a0247ac78
commit c50bd95258
1 changed files with 2 additions and 3 deletions

View File

@ -248,9 +248,8 @@ bool GBAThreadStart(struct GBAThread* threadContext) {
strncpy(savedata, threadContext->fname, dotPoint - threadContext->fname + 1);
strcat(savedata, "sav");
} else {
savedata = malloc(strlen(threadContext->fname + 5));
strcpy(savedata, threadContext->fname);
strcat(savedata, "sav");
savedata = malloc(strlen(threadContext->fname + 5) * sizeof(char));
sprintf(savedata, "%s.sav", threadContext->fname);
}
threadContext->save = VFileOpen(savedata, O_RDWR | O_CREAT);
free(savedata);