- Tidy some specified bound equals destination size warnings from GCC.

This commit is contained in:
Mitchell Richters 2021-12-12 15:51:22 +11:00 committed by Christoph Oelckers
parent b89bba5ed1
commit a4d165a84e
4 changed files with 7 additions and 7 deletions

View file

@ -141,7 +141,7 @@ bool FMD3Model::Load(const char * path, int lumpnum, const char * buffer, int le
Frames.Resize(numFrames);
for (unsigned i = 0; i < numFrames; i++)
{
strncpy(Frames[i].Name, frm[i].Name, 16);
strncpy(Frames[i].Name, frm[i].Name, 15);
for (int j = 0; j < 3; j++) Frames[i].origin[j] = frm[i].localorigin[j];
}

View file

@ -131,9 +131,9 @@ static void ParseStatistics(const char *fn, TArray<FStatistics> &statlist)
sc.MustGetString();
sc.MustGetString();
strncpy(session.name, sc.String, 24);
strncpy(session.name, sc.String, 23);
sc.MustGetString();
strncpy(session.info, sc.String, 60);
strncpy(session.info, sc.String, 59);
int h,m,s;
sc.MustGetString();
@ -149,9 +149,9 @@ static void ParseStatistics(const char *fn, TArray<FStatistics> &statlist)
FLevelStatistics &lstats = session.levelstats[session.levelstats.Reserve(1)];
sc.MustGetString();
strncpy(lstats.name, sc.String, 24);
strncpy(lstats.name, sc.String, 23);
sc.MustGetString();
strncpy(lstats.info, sc.String, 60);
strncpy(lstats.info, sc.String, 59);
int h,m,s;
sc.MustGetString();

View file

@ -50,7 +50,7 @@ void levelInitINI(const char *pzIni)
if (!fileSystem.FileExists(pzIni))
I_Error("Initialization: %s does not exist", pzIni);
BloodINI = new IniFile(pzIni);
strncpy(BloodIniFile, pzIni, BMAX_PATH);
strncpy(BloodIniFile, pzIni, BMAX_PATH-1);
}
void CheckSectionAbend(const char *pzSection)

View file

@ -64,7 +64,7 @@ void InitNetPlayerOptions(void)
// short pnum;
PLAYERp pp = Player + myconnectindex;
strncpy(pp->PlayerName, playername, 32);
strncpy(pp->PlayerName, playername, 31);
// myconnectindex palette
pp->TeamColor = gs.NetColor;