diff --git a/source/chatlib.cpp b/source/chatlib.cpp index bd7931f..478fe4a 100644 --- a/source/chatlib.cpp +++ b/source/chatlib.cpp @@ -209,7 +209,7 @@ void Bot::PrepareChatMessage (char *text) else if (*pattern == 'r') { int time = static_cast (g_timeRoundEnd - GetWorldTime ()); - strcat (m_tempStrings, FormatBuffer ("%02d:%02d", time / 60, time % 60)); + strncat (m_tempStrings, FormatBuffer ("%02d:%02d", time / 60, time % 60), SIZEOF_CHAR (m_tempStrings)); } // chat reply? else if (*pattern == 's') @@ -322,7 +322,7 @@ void Bot::PrepareChatMessage (char *text) strncpy (tempString, textStart, SIZEOF_CHAR (tempString)); HumanizeChat (tempString); - strcat (m_tempStrings, tempString); + strncat (m_tempStrings, tempString, SIZEOF_CHAR (m_tempStrings)); } } diff --git a/source/support.cpp b/source/support.cpp index b0c3a2b..28c4191 100644 --- a/source/support.cpp +++ b/source/support.cpp @@ -1222,7 +1222,7 @@ char *Localizer::TranslateInput (const char *input) if (ptr != input) ptr++; - strncpy (string, input, ARRAYSIZE_HLSDK (string)); + strncpy (string, input, SIZEOF_CHAR (string)); strtrim (string); FOR_EACH_AE (m_langTab, i) diff --git a/source/waypoint.cpp b/source/waypoint.cpp index 8330889..ec47286 100644 --- a/source/waypoint.cpp +++ b/source/waypoint.cpp @@ -909,7 +909,7 @@ void Waypoint::InitExperienceTab (void) ExtensionHeader header; memset (&header, 0, sizeof (header)); - if (fp.Read (&header, sizeof (ExtensionHeader)) == 0) + if (fp.Read (&header, sizeof (header)) == 0) { AddLogEntry (true, LL_ERROR, "Experience data damaged (unable to read header)"); @@ -1006,7 +1006,7 @@ void Waypoint::InitVisibilityTab (void) } // read the header of the file - if (fp.Read (&header, sizeof (ExtensionHeader)) == 0) + if (fp.Read (&header, sizeof (header)) == 0) { AddLogEntry (true, LL_ERROR, "Vistable damaged (unable to read header)"); @@ -1071,11 +1071,11 @@ bool Waypoint::Load (void) File fp (CheckSubfolderFile (), "rb"); WaypointHeader header; - memset (&header, 0, sizeof (WaypointHeader)); + memset (&header, 0, sizeof (header)); if (fp.IsValid ()) { - if (fp.Read (&header, sizeof (WaypointHeader)) == 0) + if (fp.Read (&header, sizeof (header)) == 0) { sprintf (m_infoBuffer, "%s.pwf - damaged waypoint file (unable to read header)", GetMapName ()); AddLogEntry (true, LL_ERROR, m_infoBuffer);