Fix naming of savegames from files with no .
Jeffrey Pfau jeffrey@endrift.com
Fri, 18 Jul 2014 00:53:08 -0700
1 files changed,
2 insertions(+),
3 deletions(-)
jump to
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -248,9 +248,8 @@ savedata = malloc((dotPoint - threadContext->fname + 5) * sizeof(char));
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);