diff --git a/source/common/models/models_md3.cpp b/source/common/models/models_md3.cpp index c40f78e1e..2975adb3d 100644 --- a/source/common/models/models_md3.cpp +++ b/source/common/models/models_md3.cpp @@ -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]; } diff --git a/source/core/statistics.cpp b/source/core/statistics.cpp index ceeb10b25..9fd88041f 100644 --- a/source/core/statistics.cpp +++ b/source/core/statistics.cpp @@ -131,9 +131,9 @@ static void ParseStatistics(const char *fn, TArray &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 &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(); diff --git a/source/games/blood/src/levels.cpp b/source/games/blood/src/levels.cpp index 89774d331..f60c981e8 100644 --- a/source/games/blood/src/levels.cpp +++ b/source/games/blood/src/levels.cpp @@ -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) diff --git a/source/games/sw/src/network.cpp b/source/games/sw/src/network.cpp index 5ae60cf13..7a01ea9bb 100644 --- a/source/games/sw/src/network.cpp +++ b/source/games/sw/src/network.cpp @@ -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;