diff options
author | negativeExponent | 2020-05-23 12:09:11 +0800 |
---|---|---|
committer | negativeExponent | 2020-05-23 12:09:11 +0800 |
commit | 4b7da20a2de9b8dcd266e2d69b13259cb364d451 (patch) | |
tree | 9cf1418956a3b5173355447b4be3c398d1ca345d | |
parent | f4c902e02372bf11f6b1afcd26d22564276fe00a (diff) | |
download | pcsx_rearmed-4b7da20a2de9b8dcd266e2d69b13259cb364d451.tar.gz pcsx_rearmed-4b7da20a2de9b8dcd266e2d69b13259cb364d451.tar.bz2 pcsx_rearmed-4b7da20a2de9b8dcd266e2d69b13259cb364d451.zip |
Silence some warnings
Silences some [-Wformat-truncation=] and [-Wstringop-truncation]
-rw-r--r-- | frontend/main.c | 7 | ||||
-rw-r--r-- | libpcsxcore/misc.c | 2 | ||||
-rw-r--r-- | libpcsxcore/psxcounters.c | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/frontend/main.c b/frontend/main.c index 64be927..b1ee4c7 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -307,7 +307,7 @@ static int cdidcmp(const char *id1, const char *id2) static void parse_cwcheat(void) { - char line[256], buf[64], name[64], *p; + char line[256], buf[256], name[256], *p; int newcheat = 1; u32 a, v; FILE *f; @@ -883,8 +883,9 @@ static int _OpenPlugins(void) { MAKE_PATH(dotdir, "/.pcsx/plugins/", NULL); strcpy(info.EmuName, "PCSX"); - strncpy(info.CdromID, CdromId, 9); - strncpy(info.CdromLabel, CdromLabel, 9); + memcpy(info.CdromID, CdromId, 9); /* no \0 trailing character? */ + memcpy(info.CdromLabel, CdromLabel, 9); + info.CdromLabel[9] = '\0'; info.psxMem = psxM; info.GPU_showScreenPic = GPU_showScreenPic; info.GPU_displayText = GPU_displayText; diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index d877513..d42576c 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -392,7 +392,7 @@ int CheckCdrom() { } if (CdromLabel[0] == ' ') { - strncpy(CdromLabel, CdromId, 9); + memcpy(CdromLabel, CdromId, 9); } SysPrintf(_("CD-ROM Label: %.32s\n"), CdromLabel); SysPrintf(_("CD-ROM ID: %.9s\n"), CdromId); diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 35823da..bebec87 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -64,7 +64,9 @@ static const u32 HSyncTotal[] = { 263, 313 }; #define VBlankStart 240 #define VERBOSE_LEVEL 0 +#if VERBOSE_LEVEL > 0 static const s32 VerboseLevel = VERBOSE_LEVEL; +#endif /******************************************************************************/ |