From a830d48412fa95b734b53dacf1c6d29aa34a0afb Mon Sep 17 00:00:00 2001 From: Daryl Date: Sun, 28 Jun 2020 17:02:47 -0600 Subject: [PATCH] fix compilation, silence some warnings --- source/filebrowser.cpp | 3 ++- source/vbasupport.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/filebrowser.cpp b/source/filebrowser.cpp index f77224c..ebbf3e4 100644 --- a/source/filebrowser.cpp +++ b/source/filebrowser.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -235,7 +236,7 @@ int UpdateDirName() if ((strlen(browser.dir)+1+strlen(browserList[browser.selIndex].filename)) < MAXPATHLEN) { /* 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; } else diff --git a/source/vbasupport.cpp b/source/vbasupport.cpp index 223cba1..69af84a 100644 --- a/source/vbasupport.cpp +++ b/source/vbasupport.cpp @@ -402,7 +402,7 @@ bool SaveBatteryOrState(char * filepath, int action, bool silent) char screenpath[1024]; strncpy(screenpath, filepath, 1024); screenpath[strlen(screenpath)-4] = 0; - sprintf(screenpath, "%s.png", screenpath); + strcat(screenpath, ".png"); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); } @@ -505,7 +505,7 @@ int SavePreviewImg(char * filepath, bool silent) char screenpath[1024]; strcpy(screenpath, filepath); screenpath[strlen(screenpath)] = 0; - sprintf(screenpath, "%s.png", screenpath); + strcat(screenpath, ".png"); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); }