mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-31 12:40:43 +00:00
Changed some of the strcat to Q_strncatz, might have solved a crash I frequently got before but not since these modifications.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2615 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6afef2b2f0
commit
70c4b63f61
2 changed files with 11 additions and 11 deletions
|
@ -486,37 +486,37 @@ void CL_SendConnectPacket (
|
||||||
sprintf(data, "%c%c%c%cconnect", 255, 255, 255, 255);
|
sprintf(data, "%c%c%c%cconnect", 255, 255, 255, 255);
|
||||||
|
|
||||||
if (clients>1) //splitscreen 'connect' command specifies the number of userinfos sent.
|
if (clients>1) //splitscreen 'connect' command specifies the number of userinfos sent.
|
||||||
strcat(data, va("%i", clients));
|
Q_strncatz(data, va("%i", clients), sizeof(data));
|
||||||
|
|
||||||
#ifdef Q2CLIENT
|
#ifdef Q2CLIENT
|
||||||
if (cls.protocol == CP_QUAKE2)
|
if (cls.protocol == CP_QUAKE2)
|
||||||
strcat(data, va(" %i", PROTOCOL_VERSION_Q2));
|
Q_strncatz(data, va(" %i", PROTOCOL_VERSION_Q2), sizeof(data));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
strcat(data, va(" %i", PROTOCOL_VERSION));
|
Q_strncatz(data, va(" %i", PROTOCOL_VERSION), sizeof(data));
|
||||||
|
|
||||||
|
|
||||||
strcat(data, va(" %i %i", cls.qport, cls.challenge));
|
Q_strncatz(data, va(" %i %i", cls.qport, cls.challenge), sizeof(data));
|
||||||
|
|
||||||
//userinfo 0 + zquake extension info.
|
//userinfo 0 + zquake extension info.
|
||||||
strcat(data, va(" \"%s\\*z_ext\\%i\"", cls.userinfo, SUPPORTED_Z_EXTENSIONS));
|
Q_strncatz(data, va(" \"%s\\*z_ext\\%i\"", cls.userinfo, SUPPORTED_Z_EXTENSIONS), sizeof(data));
|
||||||
for (c = 1; c < clients; c++)
|
for (c = 1; c < clients; c++)
|
||||||
{
|
{
|
||||||
Info_SetValueForStarKey (playerinfo2, "name", va("%s%i", name.string, c+1), MAX_INFO_STRING);
|
Info_SetValueForStarKey (playerinfo2, "name", va("%s%i", name.string, c+1), MAX_INFO_STRING);
|
||||||
strcat(data, va(" \"%s\"", playerinfo2, SUPPORTED_Z_EXTENSIONS));
|
Q_strncatz(data, va(" \"%s\"", playerinfo2, SUPPORTED_Z_EXTENSIONS), sizeof(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(data, "\n");
|
Q_strncatz(data, "\n", sizeof(data));
|
||||||
|
|
||||||
#ifdef PROTOCOL_VERSION_FTE
|
#ifdef PROTOCOL_VERSION_FTE
|
||||||
if (ftepext)
|
if (ftepext)
|
||||||
strcat(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_FTE, fteprotextsupported));
|
Q_strncatz(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_FTE, fteprotextsupported), sizeof(data));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HUFFNETWORK
|
#ifdef HUFFNETWORK
|
||||||
if (compressioncrc && Huff_CompressionCRC(compressioncrc))
|
if (compressioncrc && Huff_CompressionCRC(compressioncrc))
|
||||||
{
|
{
|
||||||
strcat(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_HUFFMAN, LittleLong(compressioncrc)));
|
Q_strncatz(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_HUFFMAN, LittleLong(compressioncrc)), sizeof(data));
|
||||||
cls.netchan.compress = true;
|
cls.netchan.compress = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -87,7 +87,7 @@ int Script_Read(int handle, struct pc_token_s *token)
|
||||||
sc->lastreaddepth = sc->stackdepth;
|
sc->lastreaddepth = sc->stackdepth;
|
||||||
|
|
||||||
s = (char *)COM_ParseToken(s, Q3SCRIPTPUNCTUATION);
|
s = (char *)COM_ParseToken(s, Q3SCRIPTPUNCTUATION);
|
||||||
strcpy(readstring, com_token);
|
Q_strncpyz(readstring, com_token, sizeof(readstring));
|
||||||
if (com_tokentype == TTP_STRING)
|
if (com_tokentype == TTP_STRING)
|
||||||
{
|
{
|
||||||
while(s)
|
while(s)
|
||||||
|
@ -105,7 +105,7 @@ int Script_Read(int handle, struct pc_token_s *token)
|
||||||
if (*s == '\"')
|
if (*s == '\"')
|
||||||
{
|
{
|
||||||
s = (char*)COM_ParseToken(s, Q3SCRIPTPUNCTUATION);
|
s = (char*)COM_ParseToken(s, Q3SCRIPTPUNCTUATION);
|
||||||
strcat(readstring, com_token);
|
Q_strncatz(readstring, com_token, sizeof(readstring));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue