From 3629710c7211800dc0e32e5cae21849cbe828e74 Mon Sep 17 00:00:00 2001 From: Daryl Date: Sun, 28 Jun 2020 15:55:56 -0600 Subject: [PATCH] cleanup more warnings --- source/fceustate.cpp | 4 ++-- source/filebrowser.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/fceustate.cpp b/source/fceustate.cpp index 3dc1c03..d68edc1 100644 --- a/source/fceustate.cpp +++ b/source/fceustate.cpp @@ -42,7 +42,7 @@ bool SaveState (char * filepath, 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); } @@ -125,7 +125,7 @@ bool SavePreviewImg (char * filepath, bool silent) char screenpath[1024]; strncpy(screenpath, filepath, 1024); screenpath[strlen(screenpath)] = 0; - sprintf(screenpath, "%s.png", screenpath); + strcat(screenpath, ".png"); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); } diff --git a/source/filebrowser.cpp b/source/filebrowser.cpp index 50c53d5..818842d 100644 --- a/source/filebrowser.cpp +++ b/source/filebrowser.cpp @@ -237,7 +237,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