fix compilation, silence some warnings

This commit is contained in:
Daryl 2020-06-28 17:02:47 -06:00
parent 40ee77b115
commit a830d48412
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <string>
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include <sys/dir.h> #include <sys/dir.h>
#include <malloc.h> #include <malloc.h>
@ -235,7 +236,7 @@ int UpdateDirName()
if ((strlen(browser.dir)+1+strlen(browserList[browser.selIndex].filename)) < MAXPATHLEN) if ((strlen(browser.dir)+1+strlen(browserList[browser.selIndex].filename)) < MAXPATHLEN)
{ {
/* update current directory name */ /* update current directory name */
sprintf(browser.dir, "%s%s/",browser.dir, browserList[browser.selIndex].filename); sprintf(browser.dir+strlen(browser.dir), "%s/", browserList[browser.selIndex].filename);
return 1; return 1;
} }
else else

View File

@ -402,7 +402,7 @@ bool SaveBatteryOrState(char * filepath, int action, bool silent)
char screenpath[1024]; char screenpath[1024];
strncpy(screenpath, filepath, 1024); strncpy(screenpath, filepath, 1024);
screenpath[strlen(screenpath)-4] = 0; screenpath[strlen(screenpath)-4] = 0;
sprintf(screenpath, "%s.png", screenpath); strcat(screenpath, ".png");
SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent);
} }
@ -505,7 +505,7 @@ int SavePreviewImg(char * filepath, bool silent)
char screenpath[1024]; char screenpath[1024];
strcpy(screenpath, filepath); strcpy(screenpath, filepath);
screenpath[strlen(screenpath)] = 0; screenpath[strlen(screenpath)] = 0;
sprintf(screenpath, "%s.png", screenpath); strcat(screenpath, ".png");
SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent);
} }