Silence warning -Wformat-overflow
authorretro-wertz <retro-wertz@users.noreply.github.com>
Sat, 3 Aug 2019 00:35:12 +0000 (08:35 +0800)
committerretro-wertz <retro-wertz@users.noreply.github.com>
Sat, 3 Aug 2019 00:35:12 +0000 (08:35 +0800)
- Increasing the maximum size of destination char array to x2 to silence this warning.

frontend/main.c
libpcsxcore/plugins.c
libpcsxcore/ppf.c

index c0bfd0f..81a68e3 100644 (file)
@@ -870,7 +870,7 @@ static int _OpenPlugins(void) {
 
        if (Config.UseNet && !NetOpened) {
                netInfo info;
-               char path[MAXPATHLEN];
+               char path[MAXPATHLEN * 2];
                char dotdir[MAXPATHLEN];
 
                MAKE_PATH(dotdir, "/.pcsx/plugins/", NULL);
index 4f52ed2..0c2b190 100644 (file)
@@ -1064,7 +1064,7 @@ void CALLBACK clearDynarec(void) {
 
 int LoadPlugins() {
        int ret;
-       char Plugin[MAXPATHLEN];
+       char Plugin[MAXPATHLEN * 2];
 
        ReleasePlugins();
        SysLibError();
@@ -1169,7 +1169,7 @@ int ReloadCdromPlugin()
        if (UsingIso()) {
                LoadCDRplugin(NULL);
        } else {
-               char Plugin[MAXPATHLEN];
+               char Plugin[MAXPATHLEN * 2];
                sprintf(Plugin, "%s/%s", Config.PluginsDir, Config.Cdr);
                if (LoadCDRplugin(Plugin) == -1) return -1;
        }
index edebdd0..f6ccfca 100644 (file)
@@ -183,7 +183,7 @@ void BuildPPFCache() {
        char                    method, undo = 0, blockcheck = 0;
        int                             dizlen, dizyn;
        unsigned char   ppfmem[512];
-       char                    szPPF[MAXPATHLEN];
+       char                    szPPF[MAXPATHLEN * 2];
        int                             count, seekpos, pos;
        u32                             anz; // use 32-bit to avoid stupid overflows
        s32                             ladr, off, anx;