mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Use safe version of sprintf and strcpy
This commit is contained in:
parent
a69d9d4483
commit
f9d264058b
87 changed files with 402 additions and 395 deletions
|
@ -5261,7 +5261,7 @@ void CG_ClientCommandDebugMessage(centity_t *cent, const char *fmt, ...)
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(msg, fmt, argptr);
|
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == cent->currentState.number)) {
|
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == cent->currentState.number)) {
|
||||||
|
@ -5416,7 +5416,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
||||||
current_tiki = NULL;
|
current_tiki = NULL;
|
||||||
|
|
||||||
// Update the loading screen
|
// Update the loading screen
|
||||||
sprintf(tempName, "m%s", filename);
|
Com_sprintf(tempName, sizeof(tempName), "m%s", filename);
|
||||||
cgi.LoadResource(tempName);
|
cgi.LoadResource(tempName);
|
||||||
|
|
||||||
bufstart = buffer;
|
bufstart = buffer;
|
||||||
|
@ -5425,7 +5425,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
||||||
Event *ev;
|
Event *ev;
|
||||||
|
|
||||||
// grab each line as we go
|
// grab each line as we go
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qtrue));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qtrue), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5433,7 +5433,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
||||||
if (!Q_stricmp(com_token, "end") || !Q_stricmp(com_token, "server")) {
|
if (!Q_stricmp(com_token, "end") || !Q_stricmp(com_token, "server")) {
|
||||||
// skip the line
|
// skip the line
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5446,7 +5446,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
||||||
|
|
||||||
// get the rest of the line
|
// get the rest of the line
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5458,7 +5458,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
||||||
cgi.FS_FreeFile((void *)bufstart);
|
cgi.FS_FreeFile((void *)bufstart);
|
||||||
|
|
||||||
// Update the loading screen
|
// Update the loading screen
|
||||||
sprintf(tempName, "o%s", filename);
|
Com_sprintf(tempName, sizeof(tempName), "o%s", filename);
|
||||||
cgi.LoadResource(tempName);
|
cgi.LoadResource(tempName);
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
|
|
@ -356,9 +356,9 @@ void CG_EditCHShader(void)
|
||||||
|
|
||||||
pShader = CG_GetShaderUnderCrosshair(qfalse, NULL);
|
pShader = CG_GetShaderUnderCrosshair(qfalse, NULL);
|
||||||
if (pShader) {
|
if (pShader) {
|
||||||
strcpy(name, "editspecificshader ");
|
Q_strncpyz(name, "editspecificshader ", sizeof(name));
|
||||||
strcat(name, pShader->shader);
|
Q_strcat(name, sizeof(name), pShader->shader);
|
||||||
strcat(name, "\n");
|
Q_strcat(name, sizeof(name), "\n");
|
||||||
cgi.AddCommand(name);
|
cgi.AddCommand(name);
|
||||||
} else {
|
} else {
|
||||||
cgi.Printf("No surface selected\n");
|
cgi.Printf("No surface selected\n");
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ void CG_DrawSpectatorView_ver_15()
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
iClientNum = cg.snap->ps.stats[STAT_INFOCLIENT];
|
iClientNum = cg.snap->ps.stats[STAT_INFOCLIENT];
|
||||||
sprintf(buf, "%s : %i", cg.clientinfo[iClientNum].name, cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]);
|
Com_sprintf(buf, sizeof(buf), "%s : %i", cg.clientinfo[iClientNum].name, cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]);
|
||||||
|
|
||||||
hShader = 0;
|
hShader = 0;
|
||||||
color[0] = 0.5;
|
color[0] = 0.5;
|
||||||
|
|
|
@ -369,7 +369,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
||||||
if (num >= CS_OBJECTIVES && num < CS_OBJECTIVES + MAX_OBJECTIVES) {
|
if (num >= CS_OBJECTIVES && num < CS_OBJECTIVES + MAX_OBJECTIVES) {
|
||||||
cobjective_t *objective = &cg.Objectives[num - CS_OBJECTIVES];
|
cobjective_t *objective = &cg.Objectives[num - CS_OBJECTIVES];
|
||||||
objective->flags = atoi(Info_ValueForKey(str, "flags"));
|
objective->flags = atoi(Info_ValueForKey(str, "flags"));
|
||||||
strcpy(objective->text, Info_ValueForKey(str, "text"));
|
Q_strncpyz(objective->text, Info_ValueForKey(str, "text"), sizeof(objective->text));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (num) {
|
switch (num) {
|
||||||
|
@ -424,7 +424,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
||||||
if (len) {
|
if (len) {
|
||||||
qboolean streamed;
|
qboolean streamed;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
strcpy(buf, str);
|
Q_strncpyz(buf, str, sizeof(buf));
|
||||||
|
|
||||||
streamed = buf[len - 1] != '0';
|
streamed = buf[len - 1] != '0';
|
||||||
buf[len - 1] = 0;
|
buf[len - 1] = 0;
|
||||||
|
@ -826,7 +826,7 @@ void Com_Error(int level, const char *error, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, error);
|
va_start(argptr, error);
|
||||||
vsprintf(text, error, argptr);
|
Q_vsnprintf(text, sizeof(text), error, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
cgi.Error(level, "%s", text);
|
cgi.Error(level, "%s", text);
|
||||||
|
@ -838,7 +838,7 @@ void Com_Printf(const char *msg, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, msg);
|
va_start(argptr, msg);
|
||||||
vsprintf(text, msg, argptr);
|
Q_vsnprintf(text, sizeof(text), msg, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
cgi.Printf("%s", text);
|
cgi.Printf("%s", text);
|
||||||
|
|
|
@ -550,7 +550,7 @@ void CG_AnimationDebugMessage(int number, const char *fmt, ...)
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(msg, fmt, argptr);
|
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == number)) {
|
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == number)) {
|
||||||
|
@ -654,8 +654,8 @@ void CG_UpdateForceModels()
|
||||||
pszAlliesPartial = dm_playermodel->string;
|
pszAlliesPartial = dm_playermodel->string;
|
||||||
pszAxisPartial = dm_playergermanmodel->string;
|
pszAxisPartial = dm_playergermanmodel->string;
|
||||||
|
|
||||||
sprintf(szAlliesModel, "models/player/%s.tik", pszAlliesPartial);
|
Com_sprintf(szAlliesModel, sizeof(szAlliesModel), "models/player/%s.tik", pszAlliesPartial);
|
||||||
sprintf(szAxisModel, "models/player/%s.tik", pszAxisPartial);
|
Com_sprintf(szAxisModel, sizeof(szAxisModel), "models/player/%s.tik", pszAxisPartial);
|
||||||
hModel = cgi.R_RegisterModel(szAlliesModel);
|
hModel = cgi.R_RegisterModel(szAlliesModel);
|
||||||
if (!hModel) hModel = cgi.R_RegisterModel("models/player/american_army.tik");
|
if (!hModel) hModel = cgi.R_RegisterModel("models/player/american_army.tik");
|
||||||
|
|
||||||
|
|
|
@ -1576,7 +1576,7 @@ void CG_ParseCGMessage_ver_15()
|
||||||
|
|
||||||
case CGM_HUDDRAW_SHADER:
|
case CGM_HUDDRAW_SHADER:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
strcpy(cgi.HudDrawElements[iInfo].shaderName, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].shaderName, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].shaderName));
|
||||||
cgi.HudDrawElements[iInfo].string[0] = 0;
|
cgi.HudDrawElements[iInfo].string[0] = 0;
|
||||||
cgi.HudDrawElements[iInfo].pFont = NULL;
|
cgi.HudDrawElements[iInfo].pFont = NULL;
|
||||||
cgi.HudDrawElements[iInfo].fontName[0] = 0;
|
cgi.HudDrawElements[iInfo].fontName[0] = 0;
|
||||||
|
@ -1618,12 +1618,12 @@ void CG_ParseCGMessage_ver_15()
|
||||||
case CGM_HUDDRAW_STRING:
|
case CGM_HUDDRAW_STRING:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
cgi.HudDrawElements[iInfo].hShader = 0;
|
cgi.HudDrawElements[iInfo].hShader = 0;
|
||||||
strcpy(cgi.HudDrawElements[iInfo].string, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].string, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].string));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CGM_HUDDRAW_FONT:
|
case CGM_HUDDRAW_FONT:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
strcpy(cgi.HudDrawElements[iInfo].fontName, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].fontName, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].fontName));
|
||||||
cgi.HudDrawElements[iInfo].hShader = 0;
|
cgi.HudDrawElements[iInfo].hShader = 0;
|
||||||
cgi.HudDrawElements[iInfo].shaderName[0] = 0;
|
cgi.HudDrawElements[iInfo].shaderName[0] = 0;
|
||||||
// load the font
|
// load the font
|
||||||
|
@ -1958,7 +1958,7 @@ void CG_ParseCGMessage_ver_6()
|
||||||
|
|
||||||
case CGM6_HUDDRAW_SHADER:
|
case CGM6_HUDDRAW_SHADER:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
strcpy(cgi.HudDrawElements[iInfo].shaderName, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].shaderName, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].shaderName));
|
||||||
cgi.HudDrawElements[iInfo].string[0] = 0;
|
cgi.HudDrawElements[iInfo].string[0] = 0;
|
||||||
cgi.HudDrawElements[iInfo].pFont = NULL;
|
cgi.HudDrawElements[iInfo].pFont = NULL;
|
||||||
cgi.HudDrawElements[iInfo].fontName[0] = 0;
|
cgi.HudDrawElements[iInfo].fontName[0] = 0;
|
||||||
|
@ -2000,12 +2000,12 @@ void CG_ParseCGMessage_ver_6()
|
||||||
case CGM6_HUDDRAW_STRING:
|
case CGM6_HUDDRAW_STRING:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
cgi.HudDrawElements[iInfo].hShader = 0;
|
cgi.HudDrawElements[iInfo].hShader = 0;
|
||||||
strcpy(cgi.HudDrawElements[iInfo].string, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].string, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].string));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CGM6_HUDDRAW_FONT:
|
case CGM6_HUDDRAW_FONT:
|
||||||
iInfo = cgi.MSG_ReadByte();
|
iInfo = cgi.MSG_ReadByte();
|
||||||
strcpy(cgi.HudDrawElements[iInfo].fontName, cgi.MSG_ReadString());
|
Q_strncpyz(cgi.HudDrawElements[iInfo].fontName, cgi.MSG_ReadString(), sizeof(cgi.HudDrawElements[iInfo].fontName));
|
||||||
cgi.HudDrawElements[iInfo].hShader = 0;
|
cgi.HudDrawElements[iInfo].hShader = 0;
|
||||||
cgi.HudDrawElements[iInfo].shaderName[0] = 0;
|
cgi.HudDrawElements[iInfo].shaderName[0] = 0;
|
||||||
// load the font
|
// load the font
|
||||||
|
|
|
@ -190,8 +190,9 @@ void CG_ShowTrace(trace_t *trace, int passent, const char *reason)
|
||||||
assert(reason);
|
assert(reason);
|
||||||
assert(trace);
|
assert(trace);
|
||||||
|
|
||||||
sprintf(
|
Com_sprintf(
|
||||||
text,
|
text,
|
||||||
|
sizeof(text),
|
||||||
"%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
|
"%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
|
||||||
(float)cg.time / 1000.0f,
|
(float)cg.time / 1000.0f,
|
||||||
passent,
|
passent,
|
||||||
|
|
|
@ -58,19 +58,19 @@ void CG_PrepScoreBoardInfo()
|
||||||
{
|
{
|
||||||
switch (cgs.gametype) {
|
switch (cgs.gametype) {
|
||||||
case GT_TEAM_ROUNDS:
|
case GT_TEAM_ROUNDS:
|
||||||
strcpy(cg.scoresMenuName, "DM_Round_Scoreboard");
|
Q_strncpyz(cg.scoresMenuName, "DM_Round_Scoreboard", sizeof(cg.scoresMenuName));
|
||||||
break;
|
break;
|
||||||
case GT_OBJECTIVE:
|
case GT_OBJECTIVE:
|
||||||
strcpy(cg.scoresMenuName, "Obj_Scoreboard");
|
Q_strncpyz(cg.scoresMenuName, "Obj_Scoreboard", sizeof(cg.scoresMenuName));
|
||||||
break;
|
break;
|
||||||
case GT_TOW:
|
case GT_TOW:
|
||||||
strcpy(cg.scoresMenuName, "Tow_Scoreboard");
|
Q_strncpyz(cg.scoresMenuName, "Tow_Scoreboard", sizeof(cg.scoresMenuName));
|
||||||
break;
|
break;
|
||||||
case GT_LIBERATION:
|
case GT_LIBERATION:
|
||||||
strcpy(cg.scoresMenuName, "Lib_Scoreboard");
|
Q_strncpyz(cg.scoresMenuName, "Lib_Scoreboard", sizeof(cg.scoresMenuName));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strcpy(cg.scoresMenuName, "DM_Scoreboard");
|
Q_strncpyz(cg.scoresMenuName, "DM_Scoreboard", sizeof(cg.scoresMenuName));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,14 +296,15 @@ void CG_ParseScores_ver_15()
|
||||||
|
|
||||||
switch (iClientTeam) {
|
switch (iClientTeam) {
|
||||||
case 1:
|
case 1:
|
||||||
strcpy(szString3, cgi.LV_ConvertString("Spectators"));
|
Q_strncpyz(szString3, cgi.LV_ConvertString("Spectators"), sizeof(szString3));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
strcpy(szString3, cgi.LV_ConvertString("Free-For-Allers"));
|
Q_strncpyz(szString3, cgi.LV_ConvertString("Free-For-Allers"), sizeof(szString3));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sprintf(
|
Com_sprintf(
|
||||||
szString3,
|
szString3,
|
||||||
|
sizeof(szString3),
|
||||||
"%s - %d %s",
|
"%s - %d %s",
|
||||||
cgi.LV_ConvertString("Allies"),
|
cgi.LV_ConvertString("Allies"),
|
||||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||||
|
@ -312,8 +313,9 @@ void CG_ParseScores_ver_15()
|
||||||
iCurrentEntry++;
|
iCurrentEntry++;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
sprintf(
|
Com_sprintf(
|
||||||
szString3,
|
szString3,
|
||||||
|
sizeof(szString3),
|
||||||
"%s - %d %s",
|
"%s - %d %s",
|
||||||
cgi.LV_ConvertString("Axis"),
|
cgi.LV_ConvertString("Axis"),
|
||||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||||
|
@ -322,7 +324,7 @@ void CG_ParseScores_ver_15()
|
||||||
iCurrentEntry++;
|
iCurrentEntry++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strcpy(szString3, cgi.LV_ConvertString("No Team"));
|
Q_strncpyz(szString3, cgi.LV_ConvertString("No Team"), sizeof(szString3));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (iClientNum == -2) {
|
} else if (iClientNum == -2) {
|
||||||
|
@ -330,14 +332,14 @@ void CG_ParseScores_ver_15()
|
||||||
szString2[0] = 0;
|
szString2[0] = 0;
|
||||||
szString3[0] = 0;
|
szString3[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
strcpy(szString2, va("%i", iClientNum));
|
Q_strncpyz(szString2, va("%i", iClientNum), sizeof(szString2));
|
||||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
Q_strncpyz(szString3, cg.clientinfo[iClientNum].name, sizeof(szString3));
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||||
strcpy(szString7, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString7, cgi.Argv(5 + iCurrentEntry + iDatumCount * i), sizeof(szString7));
|
||||||
|
|
||||||
if (cgs.gametype >= GT_TEAM_ROUNDS && iClientNum == -1
|
if (cgs.gametype >= GT_TEAM_ROUNDS && iClientNum == -1
|
||||||
&& (iClientTeam == TEAM_ALLIES || iClientTeam == TEAM_AXIS)) {
|
&& (iClientTeam == TEAM_ALLIES || iClientTeam == TEAM_AXIS)) {
|
||||||
|
@ -370,19 +372,19 @@ void CG_ParseScores_ver_15()
|
||||||
} else {
|
} else {
|
||||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||||
if (iClientNum >= 0) {
|
if (iClientNum >= 0) {
|
||||||
strcpy(szString2, va("%i", iClientNum));
|
Q_strncpyz(szString2, va("%i", iClientNum), sizeof(szString2));
|
||||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
Q_strncpyz(szString3, cg.clientinfo[iClientNum].name, sizeof(szString3));
|
||||||
strcpy(szString4, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString4, cgi.Argv(1 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||||
strcpy(szString5, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString5, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||||
strcpy(szString6, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString6, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||||
strcpy(szString7, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString7, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString7));
|
||||||
} else {
|
} else {
|
||||||
szString2[0] = 0;
|
szString2[0] = 0;
|
||||||
if (iClientNum == -3) {
|
if (iClientNum == -3) {
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Players"), sizeof(szString2));
|
||||||
bIsHeader = qtrue;
|
bIsHeader = qtrue;
|
||||||
} else if (iClientNum == -2) {
|
} else if (iClientNum == -2) {
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString3));
|
||||||
bIsHeader = qtrue;
|
bIsHeader = qtrue;
|
||||||
} else {
|
} else {
|
||||||
// unknown
|
// unknown
|
||||||
|
@ -535,32 +537,32 @@ void CG_ParseScores_ver_6()
|
||||||
|
|
||||||
switch (iClientTeam) {
|
switch (iClientTeam) {
|
||||||
case 1:
|
case 1:
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString2));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Free-For-Allers"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Free-For-Allers"), sizeof(szString2));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Allies"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Allies"), sizeof(szString2));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Axis"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Axis"), sizeof(szString2));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strcpy(szString2, cgi.LV_ConvertString("No Team"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("No Team"), sizeof(szString2));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (iClientNum == -2) {
|
} else if (iClientNum == -2) {
|
||||||
// spectating
|
// spectating
|
||||||
szString2[0] = 0;
|
szString2[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
Q_strncpyz(szString2, cg.clientinfo[iClientNum].name, sizeof(szString2));
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(szString3, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString3, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString3));
|
||||||
strcpy(szString4, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString4, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||||
strcpy(szString5, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString5, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||||
strcpy(szString6, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString6, cgi.Argv(5 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||||
|
|
||||||
if (iClientNum == cg.snap->ps.clientNum) {
|
if (iClientNum == cg.snap->ps.clientNum) {
|
||||||
pItemTextColor = vThisClientTextColor;
|
pItemTextColor = vThisClientTextColor;
|
||||||
|
@ -587,17 +589,17 @@ void CG_ParseScores_ver_6()
|
||||||
} else {
|
} else {
|
||||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||||
if (iClientNum >= 0) {
|
if (iClientNum >= 0) {
|
||||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
Q_strncpyz(szString2, cg.clientinfo[iClientNum].name, sizeof(szString2));
|
||||||
strcpy(szString3, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString3, cgi.Argv(1 + iCurrentEntry + iDatumCount * i), sizeof(szString3));
|
||||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
Q_strncpyz(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||||
} else {
|
} else {
|
||||||
if (iClientNum == -3) {
|
if (iClientNum == -3) {
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Players"), sizeof(szString2));
|
||||||
bIsHeader = qtrue;
|
bIsHeader = qtrue;
|
||||||
} else if (iClientNum == -2) {
|
} else if (iClientNum == -2) {
|
||||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString2));
|
||||||
bIsHeader = qtrue;
|
bIsHeader = qtrue;
|
||||||
} else {
|
} else {
|
||||||
// unknown
|
// unknown
|
||||||
|
|
|
@ -186,7 +186,7 @@ void CG_ParseServerinfo(void)
|
||||||
if (spawnpos) {
|
if (spawnpos) {
|
||||||
Q_strncpyz(map, mapname, spawnpos - mapname + 1);
|
Q_strncpyz(map, mapname, spawnpos - mapname + 1);
|
||||||
} else {
|
} else {
|
||||||
strcpy(map, mapname);
|
Q_strncpyz(map, mapname, sizeof(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
|
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
|
||||||
|
|
|
@ -351,7 +351,7 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
||||||
} else {
|
} else {
|
||||||
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
|
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
|
||||||
cgi.anim->g_iLastEquippedWeaponStat = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
|
cgi.anim->g_iLastEquippedWeaponStat = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
|
||||||
strcpy(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]));
|
Q_strncpyz(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]), sizeof(cgi.anim->g_szLastActiveItem));
|
||||||
cgi.anim->g_iLastAnimPrefixIndex = iAnimPrefixIndex;
|
cgi.anim->g_iLastAnimPrefixIndex = iAnimPrefixIndex;
|
||||||
|
|
||||||
bAnimChanged = qtrue;
|
bAnimChanged = qtrue;
|
||||||
|
@ -359,7 +359,7 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cgi.anim->g_iLastVMAnim == -1) {
|
if (cgi.anim->g_iLastVMAnim == -1) {
|
||||||
sprintf(szAnimName, "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
|
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
|
||||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
|
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
|
||||||
|
|
||||||
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
|
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
|
||||||
|
@ -428,7 +428,7 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(szAnimName, "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
|
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
|
||||||
if (!bWeaponChanged) {
|
if (!bWeaponChanged) {
|
||||||
fCrossblendTime =
|
fCrossblendTime =
|
||||||
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||||
|
|
|
@ -1480,7 +1480,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
|
||||||
|
|
||||||
cin.currentHandle = currentHandle;
|
cin.currentHandle = currentHandle;
|
||||||
|
|
||||||
strcpy(cinTable[currentHandle].fileName, name);
|
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
|
||||||
|
|
||||||
cinTable[currentHandle].ROQSize = 0;
|
cinTable[currentHandle].ROQSize = 0;
|
||||||
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
||||||
|
@ -1655,7 +1655,7 @@ static unsigned short CL_PlayRoQ(const char* name, const char* arg, const char*
|
||||||
|
|
||||||
cin.currentHandle = currentHandle;
|
cin.currentHandle = currentHandle;
|
||||||
|
|
||||||
strcpy(cinTable[currentHandle].fileName, name);
|
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
|
||||||
|
|
||||||
cinTable[currentHandle].ROQSize = 0;
|
cinTable[currentHandle].ROQSize = 0;
|
||||||
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
||||||
|
|
|
@ -148,7 +148,7 @@ void CL_Draw3DModel(
|
||||||
|
|
||||||
hModel[iCurrNum] = model;
|
hModel[iCurrNum] = model;
|
||||||
iIndex[iCurrNum] = -1;
|
iIndex[iCurrNum] = -1;
|
||||||
strcpy(szAnimName[iCurrNum], anim);
|
Q_strncpyz(szAnimName[iCurrNum], anim, sizeof(szAnimName[iCurrNum]));
|
||||||
} else {
|
} else {
|
||||||
iCurrNum = i;
|
iCurrNum = i;
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void CL_Draw3DModel(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iIndex[iCurrNum] = -1;
|
iIndex[iCurrNum] = -1;
|
||||||
strcpy(szAnimName[iCurrNum], anim);
|
Q_strncpyz(szAnimName[iCurrNum], anim, sizeof(szAnimName[iCurrNum]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1172,12 +1172,12 @@ void CL_Setenv_f( void ) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strcpy( buffer, Cmd_Argv(1) );
|
Q_strncpyz( buffer, Cmd_Argv(1), sizeof( buffer ) );
|
||||||
strcat( buffer, "=" );
|
Q_strcat( buffer, sizeof( buffer ), "=" );
|
||||||
|
|
||||||
for ( i = 2; i < argc; i++ ) {
|
for ( i = 2; i < argc; i++ ) {
|
||||||
strcat( buffer, Cmd_Argv( i ) );
|
Q_strcat( buffer, sizeof( buffer ), Cmd_Argv( i ) );
|
||||||
strcat( buffer, " " );
|
Q_strcat( buffer, sizeof( buffer ), " " );
|
||||||
}
|
}
|
||||||
|
|
||||||
putenv( buffer );
|
putenv( buffer );
|
||||||
|
@ -2000,7 +2000,7 @@ wombat: sending conect here: an example connect string from MOHAA looks like thi
|
||||||
Info_SetValueForKey(info, "clientType", "Breakthrough");
|
Info_SetValueForKey(info, "clientType", "Breakthrough");
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(data, "connect ");
|
Q_strncpyz(data, "connect ", sizeof(data));
|
||||||
// TTimo adding " " around the userinfo string to avoid truncated userinfo on the server
|
// TTimo adding " " around the userinfo string to avoid truncated userinfo on the server
|
||||||
// (Com_TokenizeString tokenizes around spaces)
|
// (Com_TokenizeString tokenizes around spaces)
|
||||||
data[8] = '"';
|
data[8] = '"';
|
||||||
|
@ -3126,7 +3126,7 @@ void CL_VidMode_f( void ) {
|
||||||
mode = atoi( Cmd_Argv( 1 ) );
|
mode = atoi( Cmd_Argv( 1 ) );
|
||||||
|
|
||||||
if( CL_SetVidMode( mode ) ) {
|
if( CL_SetVidMode( mode ) ) {
|
||||||
sprintf( text, "%d", mode );
|
Com_sprintf( text, sizeof( text ), "%d", mode );
|
||||||
Cvar_Set( "r_mode", text );
|
Cvar_Set( "r_mode", text );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3145,10 +3145,10 @@ void CL_TikiInfoCommand_f( void ) {
|
||||||
name = Cmd_Argv( 1 );
|
name = Cmd_Argv( 1 );
|
||||||
|
|
||||||
if( strchr( name, '/' ) ) {
|
if( strchr( name, '/' ) ) {
|
||||||
strcpy( modelname, name );
|
Q_strncpyz( modelname, name, sizeof( modelname ) );
|
||||||
} else {
|
} else {
|
||||||
strcpy( modelname, "models/" );
|
Q_strncpyz( modelname, "models/", sizeof( modelname ) );
|
||||||
strcat( modelname, name );
|
Q_strcat( modelname, sizeof( modelname ), name );
|
||||||
}
|
}
|
||||||
|
|
||||||
COM_DefaultExtension( modelname, sizeof( modelname ), ".tik" );
|
COM_DefaultExtension( modelname, sizeof( modelname ), ".tik" );
|
||||||
|
@ -3997,7 +3997,7 @@ void CL_GlobalServers_f( void ) {
|
||||||
int numAddress = 0;
|
int numAddress = 0;
|
||||||
|
|
||||||
for ( i = 1; i <= MAX_MASTER_SERVERS; i++ ) {
|
for ( i = 1; i <= MAX_MASTER_SERVERS; i++ ) {
|
||||||
sprintf(command, "sv_master%d", i);
|
Com_sprintf(command, sizeof(command), "sv_master%d", i);
|
||||||
masteraddress = Cvar_VariableString(command);
|
masteraddress = Cvar_VariableString(command);
|
||||||
|
|
||||||
if(!*masteraddress)
|
if(!*masteraddress)
|
||||||
|
@ -4015,7 +4015,7 @@ void CL_GlobalServers_f( void ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(command, "sv_master%d", masterNum);
|
Com_sprintf(command, sizeof(command), "sv_master%d", masterNum);
|
||||||
masteraddress = Cvar_VariableString(command);
|
masteraddress = Cvar_VariableString(command);
|
||||||
|
|
||||||
if(!*masteraddress)
|
if(!*masteraddress)
|
||||||
|
@ -4344,10 +4344,10 @@ void CL_Dialog_f( void ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( title, Cmd_Argv( 1 ) );
|
Q_strncpyz( title, Cmd_Argv( 1 ), sizeof( title ) );
|
||||||
strcpy( cvar, Cmd_Argv( 2 ) );
|
Q_strncpyz( cvar, Cmd_Argv( 2 ), sizeof( cvar ) );
|
||||||
strcpy( command, Cmd_Argv( 3 ) );
|
Q_strncpyz( command, Cmd_Argv( 3 ), sizeof( command ) );
|
||||||
strcpy( cancelCommand, Cmd_Argv( 4 ) );
|
Q_strncpyz( cancelCommand, Cmd_Argv( 4 ), sizeof( cancelCommand ) );
|
||||||
|
|
||||||
if( Cmd_Argc() > 5 ) {
|
if( Cmd_Argc() > 5 ) {
|
||||||
width = atoi( Cmd_Argv( 5 ) );
|
width = atoi( Cmd_Argv( 5 ) );
|
||||||
|
@ -4361,17 +4361,17 @@ void CL_Dialog_f( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Cmd_Argc() > 7 ) {
|
if( Cmd_Argc() > 7 ) {
|
||||||
strcpy( shader, Cmd_Argv( 7 ) );
|
Q_strncpyz( shader, Cmd_Argv( 7 ), sizeof( shader ) );
|
||||||
} else {
|
} else {
|
||||||
shader[ 0 ] = 0;
|
shader[ 0 ] = 0;
|
||||||
}
|
}
|
||||||
if( Cmd_Argc() > 8 ) {
|
if( Cmd_Argc() > 8 ) {
|
||||||
strcpy( okshader, Cmd_Argv( 8 ) );
|
Q_strncpyz( okshader, Cmd_Argv( 8 ), sizeof(okshader) );
|
||||||
} else {
|
} else {
|
||||||
okshader[ 0 ] = 0;
|
okshader[ 0 ] = 0;
|
||||||
}
|
}
|
||||||
if( Cmd_Argc() > 9 ) {
|
if( Cmd_Argc() > 9 ) {
|
||||||
strcpy( cancelshader, Cmd_Argv( 9 ) );
|
Q_strncpyz( cancelshader, Cmd_Argv( 9 ), sizeof(cancelshader) );
|
||||||
} else {
|
} else {
|
||||||
cancelshader[ 0 ] = 0;
|
cancelshader[ 0 ] = 0;
|
||||||
}
|
}
|
||||||
|
@ -4615,7 +4615,7 @@ qboolean CL_CDKeyValidate( const char *key, const char *checksum ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(chs, "%02x", sum);
|
Com_sprintf(chs, sizeof(chs), "%02x", sum);
|
||||||
|
|
||||||
if (checksum && !Q_stricmp(chs, checksum)) {
|
if (checksum && !Q_stricmp(chs, checksum)) {
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
|
|
@ -343,7 +343,7 @@ void SCR_DrawDemoRecording( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = FS_FTell( clc.demofile );
|
pos = FS_FTell( clc.demofile );
|
||||||
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
|
Com_sprintf( string, sizeof( string ), "RECORDING %s: %ik", clc.demoName, pos / 1024 );
|
||||||
|
|
||||||
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
|
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
|
||||||
}
|
}
|
||||||
|
|
|
@ -5826,12 +5826,12 @@ void UI_EndLoad(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
file = FS_FOpenFileWrite(loadName);
|
file = FS_FOpenFileWrite(loadName);
|
||||||
sprintf(buf, "%d\n%d %d\n", 3, loadNumber, size);
|
Com_sprintf(buf, sizeof(buf), "%d\n%d %d\n", 3, loadNumber, size);
|
||||||
|
|
||||||
FS_Write(buf, strlen(buf), file);
|
FS_Write(buf, strlen(buf), file);
|
||||||
|
|
||||||
for (i = 0; i < loadNumber; i++) {
|
for (i = 0; i < loadNumber; i++) {
|
||||||
sprintf(buf, "%s\n%d\n", base[i]->name, base[i]->loadCount);
|
Com_sprintf(buf, sizeof(buf), "%s\n%d\n", base[i]->name, base[i]->loadCount);
|
||||||
FS_Write(buf, strlen(buf), file);
|
FS_Write(buf, strlen(buf), file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ void UIMapRotationListBox::PopulateRotationList()
|
||||||
maplistVar = Cvar_Get("ui_maplist_ffa", "", 0);
|
maplistVar = Cvar_Get("ui_maplist_ffa", "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(mapBuffer, maplistVar->string);
|
Q_strncpyz(mapBuffer, maplistVar->string, sizeof(mapBuffer));
|
||||||
|
|
||||||
for (token = strtok(mapBuffer, " /"); token; token = strtok(NULL, " /")) {
|
for (token = strtok(mapBuffer, " /"); token; token = strtok(NULL, " /")) {
|
||||||
if (!Q_stricmp(token, "dm")) {
|
if (!Q_stricmp(token, "dm")) {
|
||||||
|
@ -143,7 +143,7 @@ void UIMapListBox::PopulateMapList()
|
||||||
bool bHasTOW = false;
|
bool bHasTOW = false;
|
||||||
bool bHasLib = false;
|
bool bHasLib = false;
|
||||||
|
|
||||||
strcpy(mapName, filename);
|
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||||
mapName[strlen(mapName) - 4] = 0;
|
mapName[strlen(mapName) - 4] = 0;
|
||||||
|
|
||||||
if (!COM_IsMapValid(mapName)) {
|
if (!COM_IsMapValid(mapName)) {
|
||||||
|
@ -151,7 +151,7 @@ void UIMapListBox::PopulateMapList()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bTugOfWar || bLiberation) {
|
if (bTugOfWar || bLiberation) {
|
||||||
strcpy(tokenized, mapName);
|
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||||
|
|
||||||
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
||||||
if (bLiberation) {
|
if (bLiberation) {
|
||||||
|
@ -181,7 +181,7 @@ void UIMapListBox::PopulateMapList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (bObjective) {
|
} else if (bObjective) {
|
||||||
strcpy(tokenized, mapName);
|
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||||
|
|
||||||
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
||||||
if (!Q_stricmp(token, "obj")) {
|
if (!Q_stricmp(token, "obj")) {
|
||||||
|
@ -209,9 +209,9 @@ void UIMapListBox::PopulateMapList()
|
||||||
char mapName[256];
|
char mapName[256];
|
||||||
char tokenized[256];
|
char tokenized[256];
|
||||||
|
|
||||||
strcpy(mapName, filename);
|
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||||
mapName[strlen(mapName) - 4] = 0;
|
mapName[strlen(mapName) - 4] = 0;
|
||||||
strcpy(tokenized, mapName);
|
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||||
|
|
||||||
token = strtok(tokenized, "_");
|
token = strtok(tokenized, "_");
|
||||||
if (!Q_stricmp(token, "obj") || !Q_stricmp(mapName, "mp_ship_lib")) {
|
if (!Q_stricmp(token, "obj") || !Q_stricmp(mapName, "mp_ship_lib")) {
|
||||||
|
@ -237,7 +237,7 @@ void UIMapListBox::PopulateMapList()
|
||||||
const char *filename = filenames[i];
|
const char *filename = filenames[i];
|
||||||
char mapName[256];
|
char mapName[256];
|
||||||
|
|
||||||
strcpy(mapName, filename);
|
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||||
mapName[strlen(mapName) - 4] = 0;
|
mapName[strlen(mapName) - 4] = 0;
|
||||||
|
|
||||||
if (!COM_IsMapValid(mapName)) {
|
if (!COM_IsMapValid(mapName)) {
|
||||||
|
@ -356,7 +356,7 @@ void UIRotationApplyButton::Released(Event *ev)
|
||||||
char map[256];
|
char map[256];
|
||||||
bool bHasTOW = false, bHasObj = false, bHasLib = false, bHasShip = false;
|
bool bHasTOW = false, bHasObj = false, bHasLib = false, bHasShip = false;
|
||||||
|
|
||||||
strcpy(map, text);
|
Q_strncpyz(map, text, sizeof(map));
|
||||||
for (token = strtok(map, "_"); token; token = strtok(NULL, "_")) {
|
for (token = strtok(map, "_"); token; token = strtok(NULL, "_")) {
|
||||||
if (!Q_stricmp(token, "TOW")) {
|
if (!Q_stricmp(token, "TOW")) {
|
||||||
bHasTOW = true;
|
bHasTOW = true;
|
||||||
|
|
|
@ -642,9 +642,9 @@ void UIFAKKServerList::RefreshLANServerList( Event *ev )
|
||||||
|
|
||||||
static void AddFilter(char* filter, const char* value) {
|
static void AddFilter(char* filter, const char* value) {
|
||||||
if (*filter) {
|
if (*filter) {
|
||||||
strcat(filter, va(" and %s", value));
|
Q_strcat(filter, sizeof(filter), va(" and %s", value));
|
||||||
} else {
|
} else {
|
||||||
strcpy(filter, value);
|
Q_strncpyz(filter, value, sizeof(filter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,27 +86,27 @@ void View3D::PrintSound(int channel, const char *name, float vol, int rvol, floa
|
||||||
xStep = height;
|
xStep = height;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
sprintf(buf, "%d", channel);
|
Com_sprintf(buf, sizeof(buf), "%d", channel);
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
x += xStep + xStep;
|
x += xStep + xStep;
|
||||||
sprintf(buf, "%s", name);
|
Com_sprintf(buf, sizeof(buf), "%s", name);
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
x += xStep * 30.0;
|
x += xStep * 30.0;
|
||||||
sprintf(buf, "vol:%.2f", vol);
|
Com_sprintf(buf, sizeof(buf), "vol:%.2f", vol);
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
x += xStep * 8;
|
x += xStep * 8;
|
||||||
sprintf(buf, "rvol:%.2f", (float)(rvol / 128.f));
|
Com_sprintf(buf, sizeof(buf), "rvol:%.2f", (float)(rvol / 128.f));
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
x += xStep * 5;
|
x += xStep * 5;
|
||||||
sprintf(buf, "pit:%.2f", pitch);
|
Com_sprintf(buf, sizeof(buf), "pit:%.2f", pitch);
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
x += xStep * 5;
|
x += xStep * 5;
|
||||||
sprintf(buf, "base:%d", (int)base);
|
Com_sprintf(buf, sizeof(buf), "base:%d", (int)base);
|
||||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||||
|
|
||||||
line++;
|
line++;
|
||||||
|
@ -228,7 +228,7 @@ void View3D::InitSubtitle(void)
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
subs[i] = Cvar_Get(va("subtitle%d", i), "", 0);
|
subs[i] = Cvar_Get(va("subtitle%d", i), "", 0);
|
||||||
teams[i] = Cvar_Get(va("subteam%d", i), "0", 0);
|
teams[i] = Cvar_Get(va("subteam%d", i), "0", 0);
|
||||||
strcpy(oldStrings[i], subs[i]->string);
|
Q_strncpyz(oldStrings[i], subs[i]->string, sizeof(oldStrings[i]));
|
||||||
fadeTime[i] = 4000.0;
|
fadeTime[i] = 4000.0;
|
||||||
subLife[i] = 4000.0;
|
subLife[i] = 4000.0;
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ void View3D::DrawSubtitleOverlay(void)
|
||||||
int blockcount;
|
int blockcount;
|
||||||
|
|
||||||
c = buf;
|
c = buf;
|
||||||
strcpy(buf, subs[i]->string);
|
Q_strncpyz(buf, subs[i]->string, sizeof(buf));
|
||||||
|
|
||||||
total = 0;
|
total = 0;
|
||||||
end = NULL;
|
end = NULL;
|
||||||
|
@ -420,7 +420,7 @@ void View3D::DrawFPS(void)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(string, "FPS %4.1f", currentfps);
|
Com_sprintf(string, sizeof(string), "FPS %4.1f", currentfps);
|
||||||
if (currentfps > 23.94) {
|
if (currentfps > 23.94) {
|
||||||
if (cl_greenfps->integer) {
|
if (cl_greenfps->integer) {
|
||||||
m_font->setColor(UGreen);
|
m_font->setColor(UGreen);
|
||||||
|
@ -449,7 +449,7 @@ void View3D::DrawFPS(void)
|
||||||
m_font->setColor(UWhite);
|
m_font->setColor(UWhite);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(string, "wt%5d wv%5d cl%d", cls.world_tris, cls.world_verts, cls.character_lights);
|
Com_sprintf(string, sizeof(string), "wt%5d wv%5d cl%d", cls.world_tris, cls.world_verts, cls.character_lights);
|
||||||
|
|
||||||
m_font->Print(
|
m_font->Print(
|
||||||
m_font->getHeight(qfalse) * 10.0,
|
m_font->getHeight(qfalse) * 10.0,
|
||||||
|
@ -459,7 +459,7 @@ void View3D::DrawFPS(void)
|
||||||
qfalse
|
qfalse
|
||||||
);
|
);
|
||||||
|
|
||||||
sprintf(string, "t%5d v%5d Mtex%5.2f", cls.total_tris, cls.total_verts, (float)cls.total_texels * 0.00000095367432);
|
Com_sprintf(string, sizeof(string), "t%5d v%5d Mtex%5.2f", cls.total_tris, cls.total_verts, (float)cls.total_texels * 0.00000095367432);
|
||||||
|
|
||||||
m_font->Print(
|
m_font->Print(
|
||||||
m_font->getHeight(qfalse) * 10.0,
|
m_font->getHeight(qfalse) * 10.0,
|
||||||
|
|
|
@ -161,12 +161,12 @@ void S_Base_SoundList( void ) {
|
||||||
char type[4][16];
|
char type[4][16];
|
||||||
char mem[2][16];
|
char mem[2][16];
|
||||||
|
|
||||||
strcpy(type[0], "16bit");
|
Q_strncpyz(type[0], "16bit", sizeof(type[0]));
|
||||||
strcpy(type[1], "adpcm");
|
Q_strncpyz(type[1], "adpcm", sizeof(type[1]));
|
||||||
strcpy(type[2], "daub4");
|
Q_strncpyz(type[2], "daub4", sizeof(type[2]));
|
||||||
strcpy(type[3], "mulaw");
|
Q_strncpyz(type[3], "mulaw", sizeof(type[3]));
|
||||||
strcpy(mem[0], "paged out");
|
Q_strncpyz(mem[0], "paged out", sizeof(mem[0]));
|
||||||
strcpy(mem[1], "resident ");
|
Q_strncpyz(mem[1], "resident ", sizeof(mem[1]));
|
||||||
total = 0;
|
total = 0;
|
||||||
for (sfx=s_knownSfx, i=0 ; i<s_numSfx ; i++, sfx++) {
|
for (sfx=s_knownSfx, i=0 ; i<s_numSfx ; i++, sfx++) {
|
||||||
size = sfx->soundLength;
|
size = sfx->soundLength;
|
||||||
|
@ -303,7 +303,7 @@ static sfx_t *S_FindName( const char *name ) {
|
||||||
|
|
||||||
sfx = &s_knownSfx[i];
|
sfx = &s_knownSfx[i];
|
||||||
Com_Memset (sfx, 0, sizeof(*sfx));
|
Com_Memset (sfx, 0, sizeof(*sfx));
|
||||||
strcpy (sfx->soundName, name);
|
Q_strncpyz (sfx->soundName, name, sizeof(sfx->soundName));
|
||||||
|
|
||||||
sfx->next = sfxHash[hash];
|
sfx->next = sfxHash[hash];
|
||||||
sfxHash[hash] = sfx;
|
sfxHash[hash] = sfx;
|
||||||
|
|
|
@ -522,7 +522,7 @@ qboolean S_LoadSound(const char *fileName, sfx_t *sfx, int streamed, qboolean fo
|
||||||
sfx->data = NULL;
|
sfx->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(tempName, "k%s", fileName);
|
Com_sprintf(tempName, sizeof(tempName), "k%s", fileName);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
if (strstr(fileName, "sound/null.wav")) {
|
if (strstr(fileName, "sound/null.wav")) {
|
||||||
|
|
|
@ -233,7 +233,7 @@ static sfxHandle_t S_AL_BufferFind(const char *filename)
|
||||||
ptr = &knownSfx[sfx];
|
ptr = &knownSfx[sfx];
|
||||||
memset(ptr, 0, sizeof(*ptr));
|
memset(ptr, 0, sizeof(*ptr));
|
||||||
ptr->masterLoopSrc = -1;
|
ptr->masterLoopSrc = -1;
|
||||||
strcpy(ptr->filename, filename);
|
Q_strncpyz(ptr->filename, filename, sizeof(ptr->filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the handle
|
// Return the handle
|
||||||
|
|
|
@ -3357,7 +3357,7 @@ qboolean MUSIC_LoadSoundtrackFile(const char *filename)
|
||||||
load_path[0] = 0;
|
load_path[0] = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_GetToken(&buffer, true));
|
Q_strncpyz(com_token, COM_GetToken(&buffer, true), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3368,10 +3368,10 @@ qboolean MUSIC_LoadSoundtrackFile(const char *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
numargs = 1;
|
numargs = 1;
|
||||||
strcpy(args[0], com_token);
|
Q_strncpyz(args[0], com_token, sizeof(args[0]));
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_GetToken(&buffer, false));
|
Q_strncpyz(com_token, COM_GetToken(&buffer, false), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3381,14 +3381,14 @@ qboolean MUSIC_LoadSoundtrackFile(const char *filename)
|
||||||
com_token[MAX_RES_NAME - 1] = 0;
|
com_token[MAX_RES_NAME - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(args[numargs], com_token);
|
Q_strncpyz(args[numargs], com_token, sizeof(args[numargs]));
|
||||||
numargs++;
|
numargs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Q_stricmp(args[0], "path")) {
|
if (!Q_stricmp(args[0], "path")) {
|
||||||
strcpy(load_path, args[1]);
|
Q_strncpyz(load_path, args[1], sizeof(load_path));
|
||||||
if (load_path[strlen(load_path) - 1] != '/' && load_path[strlen(load_path) - 1] != '\\') {
|
if (load_path[strlen(load_path) - 1] != '/' && load_path[strlen(load_path) - 1] != '\\') {
|
||||||
strcat(load_path, "/");
|
Q_strcat(load_path, sizeof(load_path), "/");
|
||||||
}
|
}
|
||||||
} else if (args[0][0] == '!') {
|
} else if (args[0][0] == '!') {
|
||||||
for (i = 0; i < music_numsongs; i++) {
|
for (i = 0; i < music_numsongs; i++) {
|
||||||
|
@ -3421,14 +3421,14 @@ qboolean MUSIC_LoadSoundtrackFile(const char *filename)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (numargs > 1) {
|
if (numargs > 1) {
|
||||||
strcpy(alias, args[0]);
|
Q_strncpyz(alias, args[0], sizeof(alias));
|
||||||
strcpy(file, load_path);
|
Q_strncpyz(file, load_path, sizeof(file));
|
||||||
strcat(file, args[1]);
|
Q_strcat(file, sizeof(file), args[1]);
|
||||||
} else {
|
} else {
|
||||||
strcpy(file, load_path);
|
Q_strncpyz(file, load_path, sizeof(file));
|
||||||
strcat(file, args[1]);
|
Q_strcat(file, sizeof(file), args[1]);
|
||||||
|
|
||||||
strncpy(alias, args[0], strlen(args[0]) - 4);
|
Q_strncpyz(alias, args[0], strlen(args[0]) - 4);
|
||||||
file[strlen(args[0]) + MAX_RES_NAME * 2 - 4] = 0;
|
file[strlen(args[0]) + MAX_RES_NAME * 2 - 4] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3438,8 +3438,8 @@ qboolean MUSIC_LoadSoundtrackFile(const char *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
psong = &music_songs[music_numsongs];
|
psong = &music_songs[music_numsongs];
|
||||||
strcpy(psong->alias, alias);
|
Q_strncpyz(psong->alias, alias, sizeof(psong->alias));
|
||||||
strcpy(psong->path, file);
|
Q_strncpyz(psong->path, file, sizeof(psong->path));
|
||||||
music_songs[music_numsongs].fadetime = 1.0;
|
music_songs[music_numsongs].fadetime = 1.0;
|
||||||
music_songs[music_numsongs].volume = 1.0;
|
music_songs[music_numsongs].volume = 1.0;
|
||||||
music_songs[music_numsongs].flags = 0;
|
music_songs[music_numsongs].flags = 0;
|
||||||
|
|
|
@ -12282,8 +12282,9 @@ const char *Actor::DumpCallTrace(const char *pszFmt, ...) const
|
||||||
vPlayer = p->origin;
|
vPlayer = p->origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
i1 = sprintf(
|
i1 = Com_sprintf(
|
||||||
szTemp,
|
szTemp,
|
||||||
|
sizeof(szTemp),
|
||||||
"map = %s\n"
|
"map = %s\n"
|
||||||
"time = %i (%i:%02i)\n"
|
"time = %i (%i:%02i)\n"
|
||||||
"entnum = %i, targetname = '%s'\n"
|
"entnum = %i, targetname = '%s'\n"
|
||||||
|
@ -12318,7 +12319,7 @@ const char *Actor::DumpCallTrace(const char *pszFmt, ...) const
|
||||||
if (pszFmt) {
|
if (pszFmt) {
|
||||||
va_list args2;
|
va_list args2;
|
||||||
va_copy(args2, args);
|
va_copy(args2, args);
|
||||||
i2 = i1 + vsprintf(&szTemp[i1], pszFmt, args);
|
i2 = i1 + Q_vsnprintf(szTemp + i1, sizeof(szTemp) - i1, pszFmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
@ -12329,8 +12330,9 @@ const char *Actor::DumpCallTrace(const char *pszFmt, ...) const
|
||||||
|
|
||||||
t = time(0);
|
t = time(0);
|
||||||
ptm = localtime(&t);
|
ptm = localtime(&t);
|
||||||
sprintf(
|
Com_sprintf(
|
||||||
szFile,
|
szFile,
|
||||||
|
sizeof(szFile),
|
||||||
"main\\ai_trace_%s_%i_%i_%02i%02i.log",
|
"main\\ai_trace_%s_%i_%i_%02i%02i.log",
|
||||||
sv_mapname->string,
|
sv_mapname->string,
|
||||||
ptm->tm_mon + 1,
|
ptm->tm_mon + 1,
|
||||||
|
|
|
@ -120,7 +120,7 @@ void Actor::Think_DisguiseOfficer(void)
|
||||||
{
|
{
|
||||||
Com_Printf("Actor::Think_DisguiseOfficer: invalid think state %i\n", m_State);
|
Com_Printf("Actor::Think_DisguiseOfficer: invalid think state %i\n", m_State);
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"invalid think state\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"invalid think state\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ void Actor::Think_DisguiseRover(void)
|
||||||
{
|
{
|
||||||
Com_Printf("Actor::Think_DisguiseOfficer: invalid think state %i\n", m_State);
|
Com_Printf("Actor::Think_DisguiseOfficer: invalid think state %i\n", m_State);
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"invalid think state\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"invalid think state\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,7 +474,7 @@ void Actor::FinishedAnimation_Grenade(void)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"invalid grenade state in FinishedAnimation()\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"invalid grenade state in FinishedAnimation()\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("state = %i", m_eGrenadeState));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("state = %i", m_eGrenadeState));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -121,7 +121,7 @@ void Actor::Think_Weaponless(void)
|
||||||
} else {
|
} else {
|
||||||
Com_Printf("Think_Weaponless: invalid think state %i\n", m_State);
|
Com_Printf("Think_Weaponless: invalid think state %i\n", m_State);
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"invalid think state\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"invalid think state\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace("thinkstate = %i", m_State));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,8 +315,8 @@ void Animate::NewAnim(int animnum, int slot, float weight)
|
||||||
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
||||||
int eventNum;
|
int eventNum;
|
||||||
|
|
||||||
strcpy(cmdName, "_client_");
|
Q_strncpyz(cmdName, "_client_", longest + 8 + 1);
|
||||||
strcpy(cmdName + 8, single_cmd.args[0]);
|
Q_strncpyz(cmdName + 8, single_cmd.args[0], longest + 1);
|
||||||
|
|
||||||
eventNum = Event::FindEventNum(cmdName);
|
eventNum = Event::FindEventNum(cmdName);
|
||||||
|
|
||||||
|
@ -386,8 +386,8 @@ void Animate::NewAnim(int animnum, int slot, float weight)
|
||||||
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
||||||
int eventNum;
|
int eventNum;
|
||||||
|
|
||||||
strcpy(cmdName, "_client_");
|
Q_strncpyz(cmdName, "_client_", longestAllFrames + 8 + 1);
|
||||||
strcpy(cmdName + 8, single_cmd.args[0]);
|
Q_strncpyz(cmdName + 8, single_cmd.args[0], longestAllFrames + 1);
|
||||||
|
|
||||||
eventNum = Event::FindEventNum(cmdName);
|
eventNum = Event::FindEventNum(cmdName);
|
||||||
|
|
||||||
|
@ -554,8 +554,8 @@ void Animate::DoExitCommands(int slot)
|
||||||
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
const tiki_singlecmd_t& single_cmd = cmds.cmds[ii];
|
||||||
int eventNum;
|
int eventNum;
|
||||||
|
|
||||||
strcpy(cmdName, "_client_");
|
Q_strncpyz(cmdName, "_client_", longest + 8 + 1);
|
||||||
strcpy(cmdName + 8, single_cmd.args[0]);
|
Q_strncpyz(cmdName + 8, single_cmd.args[0], longest + 1);
|
||||||
|
|
||||||
eventNum = Event::FindEventNum(cmdName);
|
eventNum = Event::FindEventNum(cmdName);
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ void Archiver::FileError(const char *fmt, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
fileerror = true;
|
fileerror = true;
|
||||||
|
|
|
@ -1411,11 +1411,11 @@ void Camera::SetAutoStateEvent(Event *ev)
|
||||||
char com_token[MAX_QPATH];
|
char com_token[MAX_QPATH];
|
||||||
char com_buffer[MAX_STRING_CHARS];
|
char com_buffer[MAX_STRING_CHARS];
|
||||||
|
|
||||||
strcpy(com_buffer, ev->GetString(i));
|
Q_strncpyz(com_buffer, ev->GetString(i), sizeof(com_buffer));
|
||||||
buffer = com_buffer;
|
buffer = com_buffer;
|
||||||
// get the rest of the line
|
// get the rest of the line
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,7 +373,7 @@ void State::ParseAndProcessCommand(str command, Entity *target)
|
||||||
script.SkipToEOL();
|
script.SkipToEOL();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strcpy(args[argc], script.GetToken(false));
|
Q_strncpyz(args[argc], script.GetToken(false), sizeof(args[argc]));
|
||||||
argv[argc] = args[argc];
|
argv[argc] = args[argc];
|
||||||
argc++;
|
argc++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,7 +433,7 @@ void G_DrawDebugNumber(Vector org, float number, float scale, float r, float g,
|
||||||
left *= scale;
|
left *= scale;
|
||||||
|
|
||||||
if (precision > 0) {
|
if (precision > 0) {
|
||||||
sprintf(format, "%%.%df", precision);
|
Com_sprintf(format, sizeof(format), "%%.%df", precision);
|
||||||
text = va(format, number);
|
text = va(format, number);
|
||||||
} else {
|
} else {
|
||||||
text = va("%d", (int)number);
|
text = va("%d", (int)number);
|
||||||
|
@ -761,7 +761,7 @@ void G_DebugString(Vector pos, float scale, float r, float g, float b, const cha
|
||||||
(*gi.numDebugStrings)++;
|
(*gi.numDebugStrings)++;
|
||||||
|
|
||||||
va_start(va, pszText);
|
va_start(va, pszText);
|
||||||
vsprintf(szTemp, pszText, va);
|
Q_vsnprintf(szTemp, sizeof(szTemp), pszText, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
VectorCopy(pos, string->pos);
|
VectorCopy(pos, string->pos);
|
||||||
|
|
|
@ -1798,7 +1798,7 @@ void DM_Manager::InsertEntry(const char *entry)
|
||||||
size_t len = strlen(entry);
|
size_t len = strlen(entry);
|
||||||
|
|
||||||
if (scoreLength + len < MAX_STRING_CHARS) {
|
if (scoreLength + len < MAX_STRING_CHARS) {
|
||||||
strcpy(scoreString + scoreLength, entry);
|
Q_strncpyz(scoreString + scoreLength, entry, sizeof(scoreString) - scoreLength);
|
||||||
|
|
||||||
scoreLength += len;
|
scoreLength += len;
|
||||||
scoreEntries++;
|
scoreEntries++;
|
||||||
|
@ -1810,7 +1810,7 @@ void DM_Manager::InsertEntryNoCount(const char *entry)
|
||||||
size_t len = strlen(entry);
|
size_t len = strlen(entry);
|
||||||
|
|
||||||
if (scoreLength + len < MAX_STRING_CHARS) {
|
if (scoreLength + len < MAX_STRING_CHARS) {
|
||||||
strcpy(scoreString + scoreLength, entry);
|
Q_strncpyz(scoreString + scoreLength, entry, sizeof(scoreString) - scoreLength);
|
||||||
|
|
||||||
scoreLength += len;
|
scoreLength += len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1220,13 +1220,13 @@ void Door::ShowInfo(float fDot, float fDist)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = sprintf(szText, "%i:%i", entnum, radnum);
|
i = Com_sprintf(szText, sizeof(szText), "%i:%i", entnum, radnum);
|
||||||
if (TargetName().c_str() && TargetName()[0]) {
|
if (TargetName().c_str() && TargetName()[0]) {
|
||||||
i = sprintf(szText + i, ":%s", TargetName().c_str());
|
i = Com_sprintf(szText + i, sizeof(szText) - i, ":%s", TargetName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (health != 0) {
|
if (health != 0) {
|
||||||
i = sprintf(szText + i, ":%.1f", health);
|
i = Com_sprintf(szText + i, sizeof(szText) - i, ":%.1f", health);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DebugString(origin + Vector(0, 0, (mins.z + maxs.z) * 0.5f), 1, 1, 1, 1, szText);
|
G_DebugString(origin + Vector(0, 0, (mins.z + maxs.z) * 0.5f), 1, 1, 1, 1, szText);
|
||||||
|
|
|
@ -5624,13 +5624,13 @@ void Entity::ShowInfo(float fDot, float fDist)
|
||||||
int i;
|
int i;
|
||||||
char szText[512];
|
char szText[512];
|
||||||
if (fDot > 0.94999999 && fDist < 1024.0 && fDist > 64.0) {
|
if (fDot > 0.94999999 && fDist < 1024.0 && fDist > 64.0) {
|
||||||
i = sprintf(szText, "%i:%i", entnum, radnum);
|
i = Com_sprintf(szText, sizeof(szText), "%i:%i", entnum, radnum);
|
||||||
if (targetname.length()) {
|
if (targetname.length()) {
|
||||||
i = sprintf(&szText[i], ":%s", targetname.c_str());
|
i = Com_sprintf(szText + i, sizeof(szText) - i, ":%s", targetname.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (health != 0) {
|
if (health != 0) {
|
||||||
sprintf(&szText[i], ":%.1f", health);
|
Com_sprintf(szText + i, sizeof(szText) - i, ":%.1f", health);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DebugString(Vector(origin.x + 0, origin.y + 0, origin.z + maxs.z + 65), 1.0, 1.0, 1.0, 1.0, szText);
|
G_DebugString(Vector(origin.x + 0, origin.y + 0, origin.z + maxs.z + 65), 1.0, 1.0, 1.0, 1.0, szText);
|
||||||
|
|
|
@ -487,7 +487,7 @@ void ExplodeObject::SetDebrisModel
|
||||||
const char *ptr;
|
const char *ptr;
|
||||||
|
|
||||||
// there could be multiple space delimited models, so we need to search for the spaces.
|
// there could be multiple space delimited models, so we need to search for the spaces.
|
||||||
strcpy( string, ev->GetString( 1 ) );
|
Q_strncpyz( string, ev->GetString( 1 ), sizeof( string ) );
|
||||||
ptr = strtok( string, " " );
|
ptr = strtok( string, " " );
|
||||||
while ( ptr )
|
while ( ptr )
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,10 +104,10 @@ void G_AddBot(unsigned int num, saved_bot_t* saved)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( botName, "bot%d", clientNum - maxclients->integer + 1 );
|
Com_sprintf( botName, sizeof( botName ), "bot%d", clientNum - maxclients->integer + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( challenge, "%d", clientNum - maxclients->integer + 1 );
|
Com_sprintf( challenge, sizeof( challenge ), "%d", clientNum - maxclients->integer + 1 );
|
||||||
|
|
||||||
e->s.clientNum = clientNum;
|
e->s.clientNum = clientNum;
|
||||||
e->s.number = clientNum;
|
e->s.number = clientNum;
|
||||||
|
|
|
@ -94,7 +94,7 @@ void QDECL G_Printf(const char *fmt, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
gi.Printf(text);
|
gi.Printf(text);
|
||||||
|
@ -111,7 +111,7 @@ void QDECL G_Error(const char *fmt, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
gi.Error(ERR_DROP, text);
|
gi.Error(ERR_DROP, text);
|
||||||
|
@ -128,7 +128,7 @@ void QDECL G_Error(int type, const char *fmt, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
// need to manually crash otherwise visual studio fuck up with the stack pointer...
|
// need to manually crash otherwise visual studio fuck up with the stack pointer...
|
||||||
|
@ -336,7 +336,7 @@ void QDECL Com_Error(int level, const char *error, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, error);
|
va_start(argptr, error);
|
||||||
vsprintf(text, error, argptr);
|
Q_vsnprintf(text, sizeof(text), error, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
G_Error("%s", text);
|
G_Error("%s", text);
|
||||||
|
@ -348,7 +348,7 @@ void QDECL Com_Printf(const char *msg, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, msg);
|
va_start(argptr, msg);
|
||||||
vsprintf(text, msg, argptr);
|
Q_vsnprintf(text, sizeof(text), msg, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
gi.DPrintf("%s", text);
|
gi.DPrintf("%s", text);
|
||||||
|
@ -1894,7 +1894,7 @@ void G_ExitLevel(void)
|
||||||
gi.SendConsoleCommand(command);
|
gi.SendConsoleCommand(command);
|
||||||
} else if (!Q_stricmpn(level.nextmap, "vstr", 4)) {
|
} else if (!Q_stricmpn(level.nextmap, "vstr", 4)) {
|
||||||
// alias on another map
|
// alias on another map
|
||||||
strcpy(command, level.nextmap);
|
Q_strncpyz(command, level.nextmap, sizeof(command));
|
||||||
gi.SendConsoleCommand(command);
|
gi.SendConsoleCommand(command);
|
||||||
} else // use the level.nextmap variable
|
} else // use the level.nextmap variable
|
||||||
{
|
{
|
||||||
|
|
|
@ -853,8 +853,8 @@ const char *G_FixTIKIPath(const char *in) {
|
||||||
if(gi.FS_ReadFile( in, &buffer ) > 0) {
|
if(gi.FS_ReadFile( in, &buffer ) > 0) {
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
strcpy(path,"models/");
|
Q_strncpyz(path,"models/", sizeof(path));
|
||||||
strcat(path,in);
|
Q_strcat(path,sizeof(path),in);
|
||||||
if( gi.FS_ReadFile( in, &buffer ) > 0 ) {
|
if( gi.FS_ReadFile( in, &buffer ) > 0 ) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1379,9 +1379,9 @@ char *CanonicalTikiName(const char *szInName)
|
||||||
static char filename[1024];
|
static char filename[1024];
|
||||||
|
|
||||||
if (*szInName && Q_stricmpn("models/", szInName, 7)) {
|
if (*szInName && Q_stricmpn("models/", szInName, 7)) {
|
||||||
sprintf(filename, "models/%s", szInName);
|
Com_sprintf(filename, sizeof(filename), "models/%s", szInName);
|
||||||
} else {
|
} else {
|
||||||
strcpy(filename, szInName);
|
Q_strncpyz(filename, szInName, sizeof(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
gi.FS_CanonicalFilename(filename);
|
gi.FS_CanonicalFilename(filename);
|
||||||
|
@ -1450,7 +1450,7 @@ void CacheResource(const char *stuff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(filename, stuff);
|
Q_strncpyz(filename, stuff, sizeof(filename));
|
||||||
gi.FS_CanonicalFilename(filename);
|
gi.FS_CanonicalFilename(filename);
|
||||||
|
|
||||||
if (strstr(filename, ".wav") || strstr(filename, ".mp3")) {
|
if (strstr(filename, ".wav") || strstr(filename, ".mp3")) {
|
||||||
|
@ -2225,7 +2225,7 @@ void G_WarnPlayer(Player *player, const char *format, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
gi.SendServerCommand(player->client->ps.clientNum, "print \"%s\"\n", buffer);
|
gi.SendServerCommand(player->client->ps.clientNum, "print \"%s\"\n", buffer);
|
||||||
|
|
|
@ -929,7 +929,7 @@ void ScriptThreadLabel::Set(const char *label)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(buffer, label);
|
Q_strncpyz(buffer, label, sizeof(buffer));
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (p[0] == ':' && p[1] == ':') {
|
if (p[0] == ':' && p[1] == ':') {
|
||||||
|
@ -1022,7 +1022,7 @@ void ScriptThreadLabel::SetScript(const char *label)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(buffer, label);
|
Q_strncpyz(buffer, label, sizeof(buffer));
|
||||||
|
|
||||||
script = buffer;
|
script = buffer;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
|
@ -779,7 +779,7 @@ void Hud::TimerThink()
|
||||||
#else
|
#else
|
||||||
if( !*shader ) {
|
if( !*shader ) {
|
||||||
#endif
|
#endif
|
||||||
sprintf( buffer, string, minutes, seconds );
|
Com_sprintf( buffer, sizeof( buffer ), string, minutes, seconds );
|
||||||
|
|
||||||
SetText( buffer );
|
SetText( buffer );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -298,7 +298,7 @@ void SVCmd_WriteIP_f
|
||||||
byte b[ 4 ];
|
byte b[ 4 ];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sprintf( name, "%s/listip.cfg", GAMEVERSION );
|
Com_sprintf( name, sizeof( name ), "%s/listip.cfg", GAMEVERSION );
|
||||||
gi.SendServerCommand( 0, "print \"Writing %s.\n\"", name );
|
gi.SendServerCommand( 0, "print \"Writing %s.\n\"", name );
|
||||||
|
|
||||||
f = fopen( name, "wb" );
|
f = fopen( name, "wb" );
|
||||||
|
|
|
@ -751,7 +751,7 @@ void Item::setName(const char *i)
|
||||||
|
|
||||||
item_name = i;
|
item_name = i;
|
||||||
item_index = gi.itemindex(i);
|
item_index = gi.itemindex(i);
|
||||||
strcpy(edict->entname, i);
|
Q_strncpyz(edict->entname, i, sizeof(edict->entname));
|
||||||
|
|
||||||
prefix = GetItemPrefix(item_name);
|
prefix = GetItemPrefix(item_name);
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ void Level::SpawnEntities(char *entities, int svsTime)
|
||||||
Q_strncpyz(ent->edict->entname, ent->getClassID(), sizeof(ent->edict->entname));
|
Q_strncpyz(ent->edict->entname, ent->getClassID(), sizeof(ent->edict->entname));
|
||||||
|
|
||||||
ent->PostEvent(EV_Entity_Start, -1.0, 0);
|
ent->PostEvent(EV_Entity_Start, -1.0, 0);
|
||||||
sprintf(name, "i%d", radnum);
|
Com_sprintf(name, sizeof(name), "i%d", radnum);
|
||||||
gi.LoadResource(name);
|
gi.LoadResource(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1957,7 +1957,7 @@ void Level::SetupMaplist()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(buffer, m_voteString.c_str());
|
Q_strncpyz(buffer, m_voteString.c_str(), sizeof(buffer));
|
||||||
|
|
||||||
for (p = strtok(buffer, delim); p; p = strtok(NULL, delim)) {
|
for (p = strtok(buffer, delim); p; p = strtok(NULL, delim)) {
|
||||||
if (strstr(p, "g_gametype")) {
|
if (strstr(p, "g_gametype")) {
|
||||||
|
|
|
@ -2522,12 +2522,12 @@ void Player::InitModelFps(void)
|
||||||
char model_name[MAX_STRING_TOKENS];
|
char model_name[MAX_STRING_TOKENS];
|
||||||
char *model_replace;
|
char *model_replace;
|
||||||
|
|
||||||
strcpy(model_name, model.c_str());
|
Q_strncpyz(model_name, model.c_str(), sizeof(model_name));
|
||||||
size_t len = strlen(model_name);
|
size_t len = strlen(model_name);
|
||||||
|
|
||||||
model_replace = model_name + len - 4;
|
model_replace = model_name + len - 4;
|
||||||
|
|
||||||
strcpy(model_replace, "_fps.tik");
|
Q_strncpyz(model_replace, "_fps.tik", sizeof(model_name) - (model_replace - model_name));
|
||||||
|
|
||||||
m_fpsTiki = gi.modeltiki(model_name);
|
m_fpsTiki = gi.modeltiki(model_name);
|
||||||
}
|
}
|
||||||
|
@ -3272,14 +3272,14 @@ void Player::SetStopwatch(int iDuration, stopWatchType_t type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(szCmd, "stopwatch %i %i %i", iStartTime, iDuration, type);
|
Com_sprintf(szCmd, sizeof(szCmd), "stopwatch %i %i %i", iStartTime, iDuration, type);
|
||||||
} else {
|
} else {
|
||||||
iStartTime = 0;
|
iStartTime = 0;
|
||||||
if (iDuration) {
|
if (iDuration) {
|
||||||
iStartTime = (int)level.svsFloatTime;
|
iStartTime = (int)level.svsFloatTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(szCmd, "stopwatch %i %i", iStartTime, iDuration);
|
Com_sprintf(szCmd, sizeof(szCmd), "stopwatch %i %i", iStartTime, iDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
gi.SendServerCommand(edict - g_entities, szCmd);
|
gi.SendServerCommand(edict - g_entities, szCmd);
|
||||||
|
@ -5670,7 +5670,7 @@ void Player::GiveAllCheat(Event *ev)
|
||||||
if (gi.FS_ReadFile("global/giveall.scr", (void **)&buf, true) != -1) {
|
if (gi.FS_ReadFile("global/giveall.scr", (void **)&buf, true) != -1) {
|
||||||
buffer = buf;
|
buffer = buf;
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qtrue));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qtrue), sizeof(com_token));
|
||||||
|
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
|
@ -5681,7 +5681,7 @@ void Player::GiveAllCheat(Event *ev)
|
||||||
|
|
||||||
// get the rest of the line
|
// get the rest of the line
|
||||||
while (1) {
|
while (1) {
|
||||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||||
if (!com_token[0]) {
|
if (!com_token[0]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -8631,49 +8631,49 @@ void Player::EnsurePlayerHasAllowedWeapons()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "rifle");
|
Q_strncpyz(client->pers.dm_primary, "rifle", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "rifle")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "rifle")) {
|
||||||
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "smg");
|
Q_strncpyz(client->pers.dm_primary, "smg", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "smg")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "smg")) {
|
||||||
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "mg");
|
Q_strncpyz(client->pers.dm_primary, "mg", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "mg")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "mg")) {
|
||||||
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "shotgun");
|
Q_strncpyz(client->pers.dm_primary, "shotgun", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "shotgun")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "shotgun")) {
|
||||||
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "heavy");
|
Q_strncpyz(client->pers.dm_primary, "heavy", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "heavy")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "heavy")) {
|
||||||
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "landmine");
|
Q_strncpyz(client->pers.dm_primary, "landmine", sizeof(client->pers.dm_primary));
|
||||||
} else if (!Q_stricmp(client->pers.dm_primary, "landmine")) {
|
} else if (!Q_stricmp(client->pers.dm_primary, "landmine")) {
|
||||||
if (QueryLandminesAllowed()) {
|
if (QueryLandminesAllowed()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(client->pers.dm_primary, "sniper");
|
Q_strncpyz(client->pers.dm_primary, "sniper", sizeof(client->pers.dm_primary));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gi.cvar_set("dmflags", va("%i", dmflags->integer & ~DF_WEAPON_NO_RIFLE));
|
gi.cvar_set("dmflags", va("%i", dmflags->integer & ~DF_WEAPON_NO_RIFLE));
|
||||||
Com_Printf("No valid weapons -- re-allowing the rifle\n");
|
Com_Printf("No valid weapons -- re-allowing the rifle\n");
|
||||||
strcpy(client->pers.dm_primary, "rifle");
|
Q_strncpyz(client->pers.dm_primary, "rifle", sizeof(client->pers.dm_primary));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::EquipWeapons()
|
void Player::EquipWeapons()
|
||||||
|
@ -10471,12 +10471,12 @@ void Player::EventDMMessage(Event *ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(szPrintString, "print \"" HUD_MESSAGE_CHAT_WHITE);
|
Q_strncpyz(szPrintString, "print \"" HUD_MESSAGE_CHAT_WHITE, sizeof(szPrintString));
|
||||||
|
|
||||||
if (m_bSpectator) {
|
if (m_bSpectator) {
|
||||||
if (iMode <= 0) {
|
if (iMode <= 0) {
|
||||||
strcat(szPrintString, gi.CL_LV_ConvertString("(spectator)"));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.CL_LV_ConvertString("(spectator)"));
|
||||||
strcat(szPrintString, " ");
|
Q_strcat(szPrintString, sizeof(szPrintString), " ");
|
||||||
} else if (iMode <= game.maxclients) {
|
} else if (iMode <= game.maxclients) {
|
||||||
ent = &g_entities[iMode - 1];
|
ent = &g_entities[iMode - 1];
|
||||||
|
|
||||||
|
@ -10496,8 +10496,8 @@ void Player::EventDMMessage(Event *ev)
|
||||||
}
|
}
|
||||||
} else if (IsDead() || m_bTempSpectator) {
|
} else if (IsDead() || m_bTempSpectator) {
|
||||||
if (iMode <= 0) {
|
if (iMode <= 0) {
|
||||||
strcat(szPrintString, gi.CL_LV_ConvertString("(dead)"));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.CL_LV_ConvertString("(dead)"));
|
||||||
strcat(szPrintString, " ");
|
Q_strcat(szPrintString, sizeof(szPrintString), " ");
|
||||||
} else if (iMode <= game.maxclients) {
|
} else if (iMode <= game.maxclients) {
|
||||||
ent = &g_entities[iMode - 1];
|
ent = &g_entities[iMode - 1];
|
||||||
|
|
||||||
|
@ -10516,22 +10516,22 @@ void Player::EventDMMessage(Event *ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (iMode < 0) {
|
} else if (iMode < 0) {
|
||||||
strcat(szPrintString, gi.CL_LV_ConvertString("(team)"));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.CL_LV_ConvertString("(team)"));
|
||||||
strcat(szPrintString, " ");
|
Q_strcat(szPrintString, sizeof(szPrintString), " ");
|
||||||
} else if (iMode > 0) {
|
} else if (iMode > 0) {
|
||||||
strcat(szPrintString, gi.CL_LV_ConvertString("(private)"));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.CL_LV_ConvertString("(private)"));
|
||||||
strcat(szPrintString, " ");
|
Q_strcat(szPrintString, sizeof(szPrintString), " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(szPrintString, client->pers.netname);
|
Q_strcat(szPrintString, sizeof(szPrintString), client->pers.netname);
|
||||||
|
|
||||||
if (bInstaMessage) {
|
if (bInstaMessage) {
|
||||||
strcat(szPrintString, ": ");
|
Q_strcat(szPrintString, sizeof(szPrintString), ": ");
|
||||||
strcat(szPrintString, gi.LV_ConvertString(pTmpInstantMsg));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.LV_ConvertString(pTmpInstantMsg));
|
||||||
} else {
|
} else {
|
||||||
bool met_comment;
|
bool met_comment;
|
||||||
|
|
||||||
strcat(szPrintString, ":");
|
Q_strcat(szPrintString, sizeof(szPrintString), ":");
|
||||||
iStringLength = strlen(szPrintString);
|
iStringLength = strlen(szPrintString);
|
||||||
|
|
||||||
for (i = 2; i <= ev->NumArgs(); i++) {
|
for (i = 2; i <= ev->NumArgs(); i++) {
|
||||||
|
@ -10556,12 +10556,12 @@ void Player::EventDMMessage(Event *ev)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(szPrintString, " ");
|
Q_strcat(szPrintString, sizeof(szPrintString), " ");
|
||||||
strcat(szPrintString, gi.LV_ConvertString(sToken));
|
Q_strcat(szPrintString, sizeof(szPrintString), gi.LV_ConvertString(sToken));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(szPrintString, "\n");
|
Q_strcat(szPrintString, sizeof(szPrintString), "\n");
|
||||||
|
|
||||||
// ignore names containing comments
|
// ignore names containing comments
|
||||||
if (strstr(client->pers.netname, "//")
|
if (strstr(client->pers.netname, "//")
|
||||||
|
@ -10800,7 +10800,7 @@ str Player::GetBattleLanguageLocalFolks()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(p, ", ");
|
Q_strncpyz(p, ", ", sizeof(buf) - (p - buf));
|
||||||
p += 2;
|
p += 2;
|
||||||
curP = p;
|
curP = p;
|
||||||
remaining -= 2;
|
remaining -= 2;
|
||||||
|
@ -10811,7 +10811,7 @@ str Player::GetBattleLanguageLocalFolks()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(p, client->pers.netname);
|
Q_strncpyz(p, client->pers.netname, sizeof(buf) - (p - buf));
|
||||||
p += length;
|
p += length;
|
||||||
remaining -= length;
|
remaining -= length;
|
||||||
pFolk = pPlayer;
|
pFolk = pPlayer;
|
||||||
|
@ -10819,8 +10819,8 @@ str Player::GetBattleLanguageLocalFolks()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curP && remaining >= 2) {
|
if (curP && remaining >= 2) {
|
||||||
strcpy(curP, "and ");
|
Q_strncpyz(curP, "and ", sizeof(buf) - (curP - buf));
|
||||||
strcpy(curP + strlen(curP), pFolk->client->pers.netname);
|
Q_strncpyz(curP + strlen(curP), pFolk->client->pers.netname, sizeof(buf) - (curP + strlen(curP) - buf));
|
||||||
} else if (!pFolk) {
|
} else if (!pFolk) {
|
||||||
return "nobody";
|
return "nobody";
|
||||||
}
|
}
|
||||||
|
@ -11605,9 +11605,9 @@ void Player::UserSelectWeapon(bool bWait)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bWait) {
|
if (bWait) {
|
||||||
strcpy(buf, "stufftext \"wait 250;pushmenu ");
|
Q_strncpyz(buf, "stufftext \"wait 250;pushmenu ", sizeof(buf));
|
||||||
} else {
|
} else {
|
||||||
strcpy(buf, "stufftext \"pushmenu ");
|
Q_strncpyz(buf, "stufftext \"pushmenu ", sizeof(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dmflags->integer & DF_WEAPON_NO_RIFLE && dmflags->integer & DF_WEAPON_NO_SNIPER
|
if (dmflags->integer & DF_WEAPON_NO_RIFLE && dmflags->integer & DF_WEAPON_NO_SNIPER
|
||||||
|
@ -11616,24 +11616,24 @@ void Player::UserSelectWeapon(bool bWait)
|
||||||
&& dmflags->integer & DF_WEAPON_NO_LANDMINE && !QueryLandminesAllowed()) {
|
&& dmflags->integer & DF_WEAPON_NO_LANDMINE && !QueryLandminesAllowed()) {
|
||||||
gi.cvar_set("dmflags", va("%i", dmflags->integer & ~DF_WEAPON_NO_RIFLE));
|
gi.cvar_set("dmflags", va("%i", dmflags->integer & ~DF_WEAPON_NO_RIFLE));
|
||||||
Com_Printf("No valid weapons -- re-allowing the rifle\n");
|
Com_Printf("No valid weapons -- re-allowing the rifle\n");
|
||||||
strcpy(client->pers.dm_primary, "rifle");
|
Q_strncpyz(client->pers.dm_primary, "rifle", sizeof(client->pers.dm_primary));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (nationality) {
|
switch (nationality) {
|
||||||
case NA_BRITISH:
|
case NA_BRITISH:
|
||||||
strcat(buf, "SelectPrimaryWeapon_british\"");
|
Q_strcat(buf, sizeof(buf), "SelectPrimaryWeapon_british\"");
|
||||||
break;
|
break;
|
||||||
case NA_RUSSIAN:
|
case NA_RUSSIAN:
|
||||||
strcat(buf, "SelectPrimaryWeapon_russian\"");
|
Q_strcat(buf, sizeof(buf), "SelectPrimaryWeapon_russian\"");
|
||||||
break;
|
break;
|
||||||
case NA_GERMAN:
|
case NA_GERMAN:
|
||||||
strcat(buf, "SelectPrimaryWeapon_german\"");
|
Q_strcat(buf, sizeof(buf), "SelectPrimaryWeapon_german\"");
|
||||||
break;
|
break;
|
||||||
case NA_ITALIAN:
|
case NA_ITALIAN:
|
||||||
strcat(buf, "SelectPrimaryWeapon_italian\"");
|
Q_strcat(buf, sizeof(buf), "SelectPrimaryWeapon_italian\"");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strcat(buf, "SelectPrimaryWeapon\"");
|
Q_strcat(buf, sizeof(buf), "SelectPrimaryWeapon\"");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -803,7 +803,7 @@ GameScript *ScriptMaster::GetGameScriptInternal(str& filename)
|
||||||
gi.Error(ERR_DROP, "Script filename '%s' exceeds maximum length of %d\n", filename.c_str(), MAX_QPATH);
|
gi.Error(ERR_DROP, "Script filename '%s' exceeds maximum length of %d\n", filename.c_str(), MAX_QPATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(filepath, filename.c_str());
|
Q_strncpyz(filepath, filename.c_str(), sizeof(filepath));
|
||||||
gi.FS_CanonicalFilename(filepath);
|
gi.FS_CanonicalFilename(filepath);
|
||||||
filename = filepath;
|
filename = filepath;
|
||||||
|
|
||||||
|
@ -1111,30 +1111,30 @@ void ScriptMaster::PrintStatus(void)
|
||||||
ScriptVM *vm;
|
ScriptVM *vm;
|
||||||
|
|
||||||
for (vm = scriptClass->m_Threads; vm != NULL; vm = vm->next) {
|
for (vm = scriptClass->m_Threads; vm != NULL; vm = vm->next) {
|
||||||
sprintf(szBuffer, "%.7d", iThreadNum);
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%.7d", iThreadNum);
|
||||||
status += szBuffer + str(" ");
|
status += szBuffer + str(" ");
|
||||||
|
|
||||||
switch (vm->ThreadState()) {
|
switch (vm->ThreadState()) {
|
||||||
case THREAD_RUNNING:
|
case THREAD_RUNNING:
|
||||||
sprintf(szBuffer, "%8s", "running");
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%8s", "running");
|
||||||
iThreadRunning++;
|
iThreadRunning++;
|
||||||
break;
|
break;
|
||||||
case THREAD_WAITING:
|
case THREAD_WAITING:
|
||||||
sprintf(szBuffer, "%8s", "waiting");
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%8s", "waiting");
|
||||||
iThreadWaiting++;
|
iThreadWaiting++;
|
||||||
break;
|
break;
|
||||||
case THREAD_SUSPENDED:
|
case THREAD_SUSPENDED:
|
||||||
sprintf(szBuffer, "%8s", "suspended");
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%8s", "suspended");
|
||||||
iThreadSuspended++;
|
iThreadSuspended++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
status += szBuffer;
|
status += szBuffer;
|
||||||
|
|
||||||
sprintf(szBuffer, "%15s", vm->Label().c_str());
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%15s", vm->Label().c_str());
|
||||||
status += szBuffer + str(" ");
|
status += szBuffer + str(" ");
|
||||||
|
|
||||||
sprintf(szBuffer, "%15s", vm->Filename().c_str());
|
Com_sprintf(szBuffer, sizeof(szBuffer), "%15s", vm->Filename().c_str());
|
||||||
status += szBuffer;
|
status += szBuffer;
|
||||||
|
|
||||||
status += "\n";
|
status += "\n";
|
||||||
|
|
|
@ -4726,7 +4726,7 @@ void ScriptThread::GetPlayerIP(Event *ev)
|
||||||
|
|
||||||
ip = ent->client->pers.ip;
|
ip = ent->client->pers.ip;
|
||||||
|
|
||||||
sprintf(ip_buff, "%s:%i", ip, ent->client->pers.port);
|
Com_sprintf(ip_buff, sizeof(ip_buff), "%s:%i", ip, ent->client->pers.port);
|
||||||
|
|
||||||
ev->AddString(ip_buff);
|
ev->AddString(ip_buff);
|
||||||
}
|
}
|
||||||
|
@ -5348,7 +5348,7 @@ void ScriptThread::FileOpen(Event *ev)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
ev->AddInteger((int)(size_t)f);
|
ev->AddInteger((int)(size_t)f);
|
||||||
sprintf(buf, "%i", scriptfiles->integer + 1);
|
Com_sprintf(buf, sizeof(buf), "%i", scriptfiles->integer + 1);
|
||||||
gi.cvar_set("sv_scriptfiles", buf);
|
gi.cvar_set("sv_scriptfiles", buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -5408,7 +5408,7 @@ void ScriptThread::FileClose(Event *ev)
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ev->AddInteger(0);
|
ev->AddInteger(0);
|
||||||
sprintf(buf, "%i", scriptfiles->integer - 1);
|
Com_sprintf(buf, sizeof(buf), "%i", scriptfiles->integer - 1);
|
||||||
gi.cvar_set("sv_scriptfiles", buf);
|
gi.cvar_set("sv_scriptfiles", buf);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -6252,7 +6252,7 @@ void ScriptThread::FlagInit(Event *ev)
|
||||||
|
|
||||||
flag = new Flag;
|
flag = new Flag;
|
||||||
flag->bSignaled = false;
|
flag->bSignaled = false;
|
||||||
strcpy(flag->flagName, name);
|
Q_strncpyz(flag->flagName, name, sizeof(flag->flagName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptThread::FlagSet(Event *ev)
|
void ScriptThread::FlagSet(Event *ev)
|
||||||
|
@ -6603,7 +6603,7 @@ void ScriptThread::EventFmod(Event *ev)
|
||||||
ev->AddFloat((float)res);
|
ev->AddFloat((float)res);
|
||||||
}
|
}
|
||||||
|
|
||||||
int checkMD5(const char *filepath, char *md5Hash)
|
int checkMD5(const char *filepath, char *md5Hash, size_t destSize)
|
||||||
{
|
{
|
||||||
md5_state_t state;
|
md5_state_t state;
|
||||||
md5_byte_t digest[16];
|
md5_byte_t digest[16];
|
||||||
|
@ -6652,7 +6652,7 @@ int checkMD5(const char *filepath, char *md5Hash)
|
||||||
md5_finish(&state, digest);
|
md5_finish(&state, digest);
|
||||||
|
|
||||||
for (di = 0; di < 16; ++di) {
|
for (di = 0; di < 16; ++di) {
|
||||||
sprintf(md5Hash + di * 2, "%02x", digest[di]);
|
Com_sprintf(md5Hash + di * 2, destSize - di * 2, "%02x", digest[di]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gi.Free(buff);
|
gi.Free(buff);
|
||||||
|
@ -6660,7 +6660,7 @@ int checkMD5(const char *filepath, char *md5Hash)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int checkMD5String(const char *string, char *md5Hash)
|
int checkMD5String(const char *string, char *md5Hash, size_t destSize)
|
||||||
{
|
{
|
||||||
md5_state_t state;
|
md5_state_t state;
|
||||||
md5_byte_t digest[16];
|
md5_byte_t digest[16];
|
||||||
|
@ -6685,7 +6685,7 @@ int checkMD5String(const char *string, char *md5Hash)
|
||||||
md5_finish(&state, digest);
|
md5_finish(&state, digest);
|
||||||
|
|
||||||
for (di = 0; di < 16; ++di) {
|
for (di = 0; di < 16; ++di) {
|
||||||
sprintf(md5Hash + di * 2, "%02x", digest[di]);
|
Com_sprintf(md5Hash + di * 2, destSize - di * 2, "%02x", digest[di]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gi.Free(buff);
|
gi.Free(buff);
|
||||||
|
@ -6705,7 +6705,7 @@ void ScriptThread::Md5File(Event *ev)
|
||||||
|
|
||||||
filename = ev->GetString(1);
|
filename = ev->GetString(1);
|
||||||
|
|
||||||
ret = checkMD5(filename, hash);
|
ret = checkMD5(filename, hash, sizeof(hash));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
ev->AddInteger(-1);
|
ev->AddInteger(-1);
|
||||||
throw ScriptException("Error while generating MD5 checksum for file - md5file!\n");
|
throw ScriptException("Error while generating MD5 checksum for file - md5file!\n");
|
||||||
|
@ -6742,7 +6742,7 @@ void ScriptThread::Md5String(Event *ev)
|
||||||
|
|
||||||
text = ev->GetString(1);
|
text = ev->GetString(1);
|
||||||
|
|
||||||
ret = checkMD5String(text, hash);
|
ret = checkMD5String(text, hash, sizeof(hash));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
ev->AddInteger(-1);
|
ev->AddInteger(-1);
|
||||||
throw ScriptException("Error while generating MD5 checksum for strin!\n");
|
throw ScriptException("Error while generating MD5 checksum for strin!\n");
|
||||||
|
@ -6937,7 +6937,7 @@ void ScriptThread::GetTime(Event *ev)
|
||||||
|
|
||||||
timediff = timearray[0] - gmttime;
|
timediff = timearray[0] - gmttime;
|
||||||
|
|
||||||
sprintf(buff, "%02i:%02i:%02i", (int)timearray[0], (int)timearray[1], (int)timearray[2]);
|
Com_sprintf(buff, sizeof(buff), "%02i:%02i:%02i", (int)timearray[0], (int)timearray[1], (int)timearray[2]);
|
||||||
|
|
||||||
ev->AddString(buff);
|
ev->AddString(buff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1078,7 +1078,7 @@ int SimpleActor::GetEmotionAnim(void)
|
||||||
default:
|
default:
|
||||||
|
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"Unknown value for m_EmotionMode in SimpleActor::GetEmotionAnim\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"Unknown value for m_EmotionMode in SimpleActor::GetEmotionAnim\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace(""));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace(""));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1101,7 +1101,7 @@ int SimpleActor::GetEmotionAnim(void)
|
||||||
default:
|
default:
|
||||||
|
|
||||||
char assertStr[16317] = {0};
|
char assertStr[16317] = {0};
|
||||||
strcpy(assertStr, "\"Unknown value for m_csMood in SimpleActor::GetEmotionAnim\"\n\tMessage: ");
|
Q_strncpyz(assertStr, "\"Unknown value for m_csMood in SimpleActor::GetEmotionAnim\"\n\tMessage: ", sizeof(assertStr));
|
||||||
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace(""));
|
Q_strcat(assertStr, sizeof(assertStr), DumpCallTrace(""));
|
||||||
assert(!assertStr);
|
assert(!assertStr);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -271,7 +271,7 @@ void Alias_ListAddParms(AliasListNode_t* node, const char* parameters)
|
||||||
}
|
}
|
||||||
|
|
||||||
node->subtitle = Z_TagMalloc(strlen(token) + 1, TAG_TIKI);
|
node->subtitle = Z_TagMalloc(strlen(token) + 1, TAG_TIKI);
|
||||||
strcpy(node->subtitle, token);
|
Q_strncpyz(node->subtitle, token, sizeof(node->subtitle));
|
||||||
}
|
}
|
||||||
else if (!Q_stricmp(token, "pitch"))
|
else if (!Q_stricmp(token, "pitch"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -202,7 +202,7 @@ void CLASS_Print(FILE *class_file, const char *fmt, ...)
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
if (class_file) {
|
if (class_file) {
|
||||||
|
@ -238,7 +238,7 @@ void Class::warning(const char *function, const char *format, ...) const
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
|
|
||||||
classname = classinfo()->classname;
|
classname = classinfo()->classname;
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ void Class::error(const char *function, const char *fmt, ...) const
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(text, fmt, argptr);
|
Q_vsnprintf(text, sizeof(text), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
if (getClassID()) {
|
if (getClassID()) {
|
||||||
|
|
|
@ -311,14 +311,14 @@ qboolean CM_LoadFCM(const char *szName, cfencemask_t **pMask)
|
||||||
|
|
||||||
m = (cfencemask_t *)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
|
m = (cfencemask_t *)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
|
||||||
*pMask = m;
|
*pMask = m;
|
||||||
strcpy(m->name, szName);
|
Q_strncpyz(m->name, szName, sizeof(m->name));
|
||||||
m->iWidth = header.iWidth;
|
m->iWidth = header.iWidth;
|
||||||
m->iHeight = header.iHeight;
|
m->iHeight = header.iHeight;
|
||||||
m->pData = (byte *)Hunk_Alloc(iDataSize, h_dontcare);
|
m->pData = (byte *)Hunk_Alloc(iDataSize, h_dontcare);
|
||||||
FS_Read(m->pData, iDataSize, h);
|
FS_Read(m->pData, iDataSize, h);
|
||||||
FS_FCloseFile(h);
|
FS_FCloseFile(h);
|
||||||
|
|
||||||
sprintf(tempName, "f%s", szName);
|
Com_sprintf(tempName, sizeof(tempName), "f%s", szName);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
@ -483,7 +483,7 @@ qboolean CM_GenerateFenceMask(const char *szName, cfencemask_t **pMask)
|
||||||
// load the mask if it has transparence and is opaque
|
// load the mask if it has transparence and is opaque
|
||||||
if (bHasOpaque && bHasTrans) {
|
if (bHasOpaque && bHasTrans) {
|
||||||
*pMask = Hunk_Alloc((iMaskSize >> 3) + sizeof(cfencemask_t), h_dontcare);
|
*pMask = Hunk_Alloc((iMaskSize >> 3) + sizeof(cfencemask_t), h_dontcare);
|
||||||
strcpy((*pMask)->name, szName);
|
Q_strncpyz((*pMask)->name, szName, sizeof((*pMask)->name));
|
||||||
(*pMask)->iWidth = iWidth;
|
(*pMask)->iWidth = iWidth;
|
||||||
(*pMask)->iHeight = iHeight;
|
(*pMask)->iHeight = iHeight;
|
||||||
(*pMask)->pData = (byte *)((byte *)*pMask + sizeof(**pMask));
|
(*pMask)->pData = (byte *)((byte *)*pMask + sizeof(**pMask));
|
||||||
|
@ -564,7 +564,7 @@ cfencemask_t *CM_GetFenceMask(const char *szMaskName)
|
||||||
if (save || !CM_LoadFCM(szMaskName, &pMask)) {
|
if (save || !CM_LoadFCM(szMaskName, &pMask)) {
|
||||||
if (!CM_GenerateFenceMask(szMaskName, &pMask)) {
|
if (!CM_GenerateFenceMask(szMaskName, &pMask)) {
|
||||||
pMask = (cfencemask_t *)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
|
pMask = (cfencemask_t *)Hunk_Alloc(sizeof(cfencemask_t), h_dontcare);
|
||||||
strcpy(pMask->name, szMaskName);
|
Q_strncpyz(pMask->name, szMaskName, sizeof(pMask->name));
|
||||||
pMask->pData = NULL;
|
pMask->pData = NULL;
|
||||||
pMask->pNext = cm.fencemasks;
|
pMask->pNext = cm.fencemasks;
|
||||||
cm.fencemasks = pMask;
|
cm.fencemasks = pMask;
|
||||||
|
|
|
@ -121,7 +121,7 @@ void CMod_LoadShaders( gamelump_t *l, int **shaderSubdivisions ) {
|
||||||
|
|
||||||
out = cm.shaders;
|
out = cm.shaders;
|
||||||
for ( i=0 ; i<count ; i++, in++, out++ ) {
|
for ( i=0 ; i<count ; i++, in++, out++ ) {
|
||||||
strcpy( out->shader, in->shader );
|
Q_strncpyz( out->shader, in->shader, sizeof( out->shader ) );
|
||||||
out->contentFlags = LittleLong( in->contentFlags );
|
out->contentFlags = LittleLong( in->contentFlags );
|
||||||
out->surfaceFlags = LittleLong( in->surfaceFlags );
|
out->surfaceFlags = LittleLong( in->surfaceFlags );
|
||||||
out->mask = CM_GetFenceMask( in->fenceMaskImage );
|
out->mask = CM_GetFenceMask( in->fenceMaskImage );
|
||||||
|
@ -678,7 +678,7 @@ void CMod_LoadPatches( gamelump_t *surfs, gamelump_t *verts, int *shaderSubdivis
|
||||||
// create the internal facet structure
|
// create the internal facet structure
|
||||||
patch->pc = CM_GeneratePatchCollide( width, height, points, patch->subdivisions );
|
patch->pc = CM_GeneratePatchCollide( width, height, points, patch->subdivisions );
|
||||||
|
|
||||||
sprintf(tempName, "s%d", i);
|
Com_sprintf(tempName, sizeof(tempName), "s%d", i);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ obfuscation_t* CM_SetupObfuscationMapping() {
|
||||||
}
|
}
|
||||||
|
|
||||||
obfuscation = &list[j];
|
obfuscation = &list[j];
|
||||||
strcpy(obfuscation->name, token);
|
Q_strncpyz(obfuscation->name, token, sizeof(obfuscation->name));
|
||||||
|
|
||||||
token = CM_NextCsvToken(&text, qfalse);
|
token = CM_NextCsvToken(&text, qfalse);
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
|
|
@ -407,7 +407,7 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
|
||||||
com_errorEntered = qtrue;
|
com_errorEntered = qtrue;
|
||||||
|
|
||||||
va_start (argptr,fmt);
|
va_start (argptr,fmt);
|
||||||
vsprintf (com_errorMessage,fmt,argptr);
|
Q_vsnprintf (com_errorMessage,sizeof(com_errorMessage),fmt,argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
if (code != ERR_DISCONNECT && code != ERR_NEED_CD)
|
if (code != ERR_DISCONNECT && code != ERR_NEED_CD)
|
||||||
|
|
|
@ -308,8 +308,8 @@ void Configurator::WriteData( char **data, size_t *size )
|
||||||
currentSize += len;
|
currentSize += len;
|
||||||
currentData = new char[ currentSize + 1 ];
|
currentData = new char[ currentSize + 1 ];
|
||||||
strncpy( currentData, oldData, offset );
|
strncpy( currentData, oldData, offset );
|
||||||
sprintf( currentData + offset, offset ? "\n\n[%s]" : "[%s]", section->name.c_str() );
|
Com_sprintf( currentData + offset, currentSize + 1 - offset, offset ? "\n\n[%s]" : "[%s]", section->name.c_str() );
|
||||||
strcpy( currentData + offset + len, oldData + offset );
|
Q_strncpyz( currentData + offset + len, oldData + offset, currentSize + 1 - offset - len );
|
||||||
|
|
||||||
if( currentData != oldData ) delete[] oldData;
|
if( currentData != oldData ) delete[] oldData;
|
||||||
}
|
}
|
||||||
|
@ -360,8 +360,8 @@ void Configurator::WriteData( char **data, size_t *size )
|
||||||
currentSize += len;
|
currentSize += len;
|
||||||
currentData = new char[ currentSize + 1 ];
|
currentData = new char[ currentSize + 1 ];
|
||||||
strncpy( currentData, oldData, offset );
|
strncpy( currentData, oldData, offset );
|
||||||
sprintf( currentData + offset, "\n%s[%d]=%s", key->name.c_str(), k, value.c_str() );
|
Com_sprintf( currentData + offset, currentSize + 1 - offset, "\n%s[%d]=%s", key->name.c_str(), k, value.c_str() );
|
||||||
strcpy( currentData + offset + len, oldData + offset2 );
|
Q_strncpyz( currentData + offset + len, oldData + offset2, currentSize + 1 - offset - len );
|
||||||
|
|
||||||
if( currentData != oldData ) delete[] oldData;
|
if( currentData != oldData ) delete[] oldData;
|
||||||
}
|
}
|
||||||
|
@ -393,8 +393,8 @@ void Configurator::WriteData( char **data, size_t *size )
|
||||||
currentSize += len;
|
currentSize += len;
|
||||||
currentData = new char[ currentSize + 1 ];
|
currentData = new char[ currentSize + 1 ];
|
||||||
strncpy( currentData, oldData, offset );
|
strncpy( currentData, oldData, offset );
|
||||||
sprintf( currentData + offset, "\n%s=%s", key->name.c_str(), value.c_str() );
|
Com_sprintf( currentData + offset, currentSize + 1 - offset "\n%s=%s", key->name.c_str(), value.c_str() );
|
||||||
strcpy( currentData + offset + len, oldData + offset2 );
|
Q_strncpyz( currentData + offset + len, oldData + offset2, currentSize + 1 - offset - len );
|
||||||
|
|
||||||
if( currentData != oldData ) delete[] oldData;
|
if( currentData != oldData ) delete[] oldData;
|
||||||
}
|
}
|
||||||
|
@ -445,18 +445,18 @@ void Configurator::WriteData2( char **data, size_t *size )
|
||||||
currentSize = tlen + 1024;
|
currentSize = tlen + 1024;
|
||||||
currentData = new char[ currentSize ];
|
currentData = new char[ currentSize ];
|
||||||
p = currentData + ( p - oldData );
|
p = currentData + ( p - oldData );
|
||||||
strcpy( currentData, oldData );
|
Q_strncpyz( currentData, oldData, currentSize );
|
||||||
|
|
||||||
delete[] oldData;
|
delete[] oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( i == 1 )
|
if( i == 1 )
|
||||||
{
|
{
|
||||||
p += sprintf( p, "[%s]\n", section->name.c_str() );
|
p += Com_sprintf( p, currentSize - ( p - currentData ), "[%s]\n", section->name.c_str() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p += sprintf( p, "\n[%s]\n", section->name.c_str() );
|
p += Com_sprintf( p, currentSize - ( p - currentData ), "\n[%s]\n", section->name.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( j = 0; j < section->key.NumObjects(); j++ )
|
for( j = 0; j < section->key.NumObjects(); j++ )
|
||||||
|
@ -500,7 +500,7 @@ void Configurator::WriteData2( char **data, size_t *size )
|
||||||
delete[] oldData;
|
delete[] oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
p += sprintf( p, "%s[%d]=%s\n", key->name.c_str(), k, value.c_str() );
|
p += Com_sprintf( p, currentSize - ( p - currentData ), "%s[%d]=%s\n", key->name.c_str(), k, value.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ void Configurator::WriteData2( char **data, size_t *size )
|
||||||
delete[] oldData;
|
delete[] oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
p += sprintf( p, "%s=%s\n", key->name.c_str(), value.c_str() );
|
p += Com_sprintf( p, currentSize - ( p - currentData ), "%s=%s\n", key->name.c_str(), value.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -585,7 +585,7 @@ bool Configurator::FindData( int type, const char *s, const char *k, size_t *off
|
||||||
arrayindex = GetKeyArray( key );
|
arrayindex = GetKeyArray( key );
|
||||||
if( arrayindex >= 0 )
|
if( arrayindex >= 0 )
|
||||||
{
|
{
|
||||||
sprintf( key, "%s[%d]", key, arrayindex );
|
Com_sprintf( key, sizeof( key ), "%s[%d]", key, arrayindex );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( type == LINE_VALUE && bFoundSection && !Q_stricmp( k, key ) )
|
if( type == LINE_VALUE && bFoundSection && !Q_stricmp( k, key ) )
|
||||||
|
|
|
@ -748,7 +748,7 @@ void EV_Print(FILE *stream, const char *format, ...)
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
|
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
|
|
||||||
if (stream) {
|
if (stream) {
|
||||||
fprintf(stream, "%s", buffer);
|
fprintf(stream, "%s", buffer);
|
||||||
|
@ -863,7 +863,7 @@ void EventDef::Error(const char *format, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
EVENT_Printf("^~^~^ Game: '%s' : %s\n", command.c_str(), buffer);
|
EVENT_Printf("^~^~^ Game: '%s' : %s\n", command.c_str(), buffer);
|
||||||
|
@ -1018,7 +1018,7 @@ void EventDef::SetupDocumentation(void)
|
||||||
//
|
//
|
||||||
// store off all the names
|
// store off all the names
|
||||||
//
|
//
|
||||||
strcpy(argumentNames, argument_names);
|
Q_strncpyz(argumentNames, argument_names, sizeof(argumentNames));
|
||||||
namePtr = strtok(argumentNames, " ");
|
namePtr = strtok(argumentNames, " ");
|
||||||
while (namePtr != NULL) {
|
while (namePtr != NULL) {
|
||||||
argNames.AddObject(str(namePtr));
|
argNames.AddObject(str(namePtr));
|
||||||
|
|
|
@ -345,7 +345,7 @@ void COM_ParseError( char *format, ... )
|
||||||
static char string[4096];
|
static char string[4096];
|
||||||
|
|
||||||
va_start (argptr, format);
|
va_start (argptr, format);
|
||||||
vsprintf (string, format, argptr);
|
Q_vsnprintf (string, sizeof(string), format, argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
Com_Printf("ERROR: %s, line %d: %s\n", com_parsename, com_lines, string);
|
Com_Printf("ERROR: %s, line %d: %s\n", com_parsename, com_lines, string);
|
||||||
|
@ -357,7 +357,7 @@ void COM_ParseWarning( char *format, ... )
|
||||||
static char string[4096];
|
static char string[4096];
|
||||||
|
|
||||||
va_start (argptr, format);
|
va_start (argptr, format);
|
||||||
vsprintf (string, format, argptr);
|
Q_vsnprintf (string, sizeof(string), format, argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
Com_Printf("WARNING: %s, line %d: %s\n", com_parsename, com_lines, string);
|
Com_Printf("WARNING: %s, line %d: %s\n", com_parsename, com_lines, string);
|
||||||
|
|
|
@ -181,7 +181,7 @@ void Script::MarkPosition(scriptmarker_t *mark)
|
||||||
mark->tokenready = tokenready;
|
mark->tokenready = tokenready;
|
||||||
mark->offset = script_p - buffer;
|
mark->offset = script_p - buffer;
|
||||||
mark->line = line;
|
mark->line = line;
|
||||||
strcpy(mark->token, token);
|
Q_strncpyz(mark->token, token, sizeof(mark->token));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -199,7 +199,7 @@ void Script::RestorePosition(const scriptmarker_t *mark)
|
||||||
tokenready = mark->tokenready;
|
tokenready = mark->tokenready;
|
||||||
script_p = buffer + mark->offset;
|
script_p = buffer + mark->offset;
|
||||||
line = mark->line;
|
line = mark->line;
|
||||||
strcpy(token, mark->token);
|
Q_strncpyz(token, mark->token, sizeof(token));
|
||||||
|
|
||||||
assert(script_p <= end_p);
|
assert(script_p <= end_p);
|
||||||
if (script_p > end_p) {
|
if (script_p > end_p) {
|
||||||
|
@ -660,7 +660,7 @@ const char *Script::GetMacroString(const char *theMacroName)
|
||||||
}
|
}
|
||||||
|
|
||||||
char tmpstr[255], *sptr = tmpstr;
|
char tmpstr[255], *sptr = tmpstr;
|
||||||
strcpy(tmpstr, theMacroName);
|
Q_strncpyz(tmpstr, theMacroName, sizeof(tmpstr));
|
||||||
tmpstr[strlen(tmpstr) - 1] = 0;
|
tmpstr[strlen(tmpstr) - 1] = 0;
|
||||||
sptr++;
|
sptr++;
|
||||||
|
|
||||||
|
@ -741,7 +741,7 @@ char *Script::EvaluateMacroString(const char *theMacroString)
|
||||||
bufferptr++;
|
bufferptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(evalText, "%f", value);
|
Com_sprintf(evalText, sizeof(evalText), "%f", value);
|
||||||
return evalText;
|
return evalText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,7 +1076,7 @@ int Script::LinesInFile(void)
|
||||||
temp_tokenready = tokenready;
|
temp_tokenready = tokenready;
|
||||||
temp_script_p = script_p;
|
temp_script_p = script_p;
|
||||||
temp_line = line;
|
temp_line = line;
|
||||||
strcpy(temp_token, token);
|
Q_strncpyz(temp_token, token, sizeof(temp_token));
|
||||||
|
|
||||||
numentries = 0;
|
numentries = 0;
|
||||||
|
|
||||||
|
@ -1089,7 +1089,7 @@ int Script::LinesInFile(void)
|
||||||
tokenready = temp_tokenready;
|
tokenready = temp_tokenready;
|
||||||
script_p = temp_script_p;
|
script_p = temp_script_p;
|
||||||
line = temp_line;
|
line = temp_line;
|
||||||
strcpy(token, temp_token);
|
Q_strncpyz(token, temp_token, sizeof(token));
|
||||||
|
|
||||||
return numentries;
|
return numentries;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ str operator+(const str& a, const float b)
|
||||||
|
|
||||||
str result(a);
|
str result(a);
|
||||||
|
|
||||||
sprintf(text, "%f", b);
|
snprintf(text, sizeof(text), "%f", b);
|
||||||
result.append(text);
|
result.append(text);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -230,7 +230,7 @@ str operator+(const str& a, const int b)
|
||||||
|
|
||||||
str result(a);
|
str result(a);
|
||||||
|
|
||||||
sprintf(text, "%d", b);
|
snprintf(text, sizeof(text), "%d", b);
|
||||||
result.append(text);
|
result.append(text);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -242,7 +242,7 @@ str operator+(const str& a, const unsigned b)
|
||||||
|
|
||||||
str result(a);
|
str result(a);
|
||||||
|
|
||||||
sprintf(text, "%u", b);
|
snprintf(text, sizeof(text), "%u", b);
|
||||||
result.append(text);
|
result.append(text);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -252,7 +252,7 @@ str& str::operator+=(const float a)
|
||||||
{
|
{
|
||||||
char text[20];
|
char text[20];
|
||||||
|
|
||||||
sprintf(text, "%f", a);
|
snprintf(text, sizeof(text), "%f", a);
|
||||||
append(text);
|
append(text);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -262,7 +262,7 @@ str& str::operator+=(const int a)
|
||||||
{
|
{
|
||||||
char text[20];
|
char text[20];
|
||||||
|
|
||||||
sprintf(text, "%d", a);
|
snprintf(text, sizeof(text), "%d", a);
|
||||||
append(text);
|
append(text);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -272,7 +272,7 @@ str& str::operator+=(const unsigned a)
|
||||||
{
|
{
|
||||||
char text[20];
|
char text[20];
|
||||||
|
|
||||||
sprintf(text, "%u", a);
|
snprintf(text, sizeof(text), "%u", a);
|
||||||
append(text);
|
append(text);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -536,7 +536,7 @@ void str::snprintf(char *dst, int size, const char *fmt, ...)
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
len = vsprintf(buffer, fmt, argptr);
|
len = vsnprintf(buffer, sizeof(buffer), fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
assert(len < size);
|
assert(len < size);
|
||||||
|
|
|
@ -293,7 +293,7 @@ inline str::str(const float num)
|
||||||
char text[32];
|
char text[32];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%.3f", num);
|
snprintf(text, sizeof(text), "%.3f", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -306,7 +306,7 @@ inline str::str(const int num)
|
||||||
char text[32];
|
char text[32];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%d", num);
|
snprintf(text, sizeof(text), "%d", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -319,7 +319,7 @@ inline str::str(const unsigned int num)
|
||||||
char text[32];
|
char text[32];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%u", num);
|
snprintf(text, sizeof(text), "%u", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -332,7 +332,7 @@ inline str::str(const long num)
|
||||||
char text[64];
|
char text[64];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%ld", num);
|
snprintf(text, sizeof(text), "%ld", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -345,7 +345,7 @@ inline str::str(const unsigned long num)
|
||||||
char text[64];
|
char text[64];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%lu", num);
|
snprintf(text, sizeof(text), "%lu", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -358,7 +358,7 @@ inline str::str(const long long num)
|
||||||
char text[64];
|
char text[64];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%lld", num);
|
snprintf(text, sizeof(text), "%lld", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
@ -371,7 +371,7 @@ inline str::str(const unsigned long long num)
|
||||||
char text[64];
|
char text[64];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
sprintf(text, "%llu", num);
|
snprintf(text, sizeof(text), "%llu", num);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
EnsureAlloced(len + 1);
|
EnsureAlloced(len + 1);
|
||||||
strcpy(m_data->data, text);
|
strcpy(m_data->data, text);
|
||||||
|
|
|
@ -65,7 +65,7 @@ void TIKI_Message(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ void TIKI_Warning(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void TIKI_Error(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,8 +394,8 @@ void TikiScript::AddMacro( const char *name, const char *expansion )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy( macros[ nummacros ].name, name );
|
Q_strncpyz( macros[ nummacros ].name, name, sizeof( macros[ nummacros ].name ) );
|
||||||
strcpy( macros[ nummacros ].macro, expansion );
|
Q_strncpyz( macros[ nummacros ].macro, expansion, sizeof( macros[ nummacros ].macro ) );
|
||||||
nummacros++;
|
nummacros++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,13 +450,13 @@ qboolean TikiScript::ProcessCommand( qboolean crossline )
|
||||||
}
|
}
|
||||||
else if( !stricmp( command, "path" ) )
|
else if( !stricmp( command, "path" ) )
|
||||||
{
|
{
|
||||||
strcpy( path, argument1 );
|
Q_strncpyz( path, argument1, sizeof( path ) );
|
||||||
len = strlen( path );
|
len = strlen( path );
|
||||||
|
|
||||||
if( path[ len - 1 ] != '/' &&
|
if( path[ len - 1 ] != '/' &&
|
||||||
path[ len - 1 ] != '\\' )
|
path[ len - 1 ] != '\\' )
|
||||||
{
|
{
|
||||||
strcat( path, "/" );
|
Q_strcat( path, sizeof( path ), "/" );
|
||||||
}
|
}
|
||||||
|
|
||||||
SkipToEOL();
|
SkipToEOL();
|
||||||
|
@ -790,7 +790,7 @@ const char *TikiScript::GetToken( qboolean crossline )
|
||||||
{
|
{
|
||||||
strcat( temptoken, macro_end + 1 );
|
strcat( temptoken, macro_end + 1 );
|
||||||
}
|
}
|
||||||
strcpy( i->token, temptoken );
|
Q_strncpyz( i->token, temptoken, sizeof( i->token ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -808,7 +808,7 @@ const char *TikiScript::GetToken( qboolean crossline )
|
||||||
{
|
{
|
||||||
strcat( temptoken, macro_end + 1 );
|
strcat( temptoken, macro_end + 1 );
|
||||||
}
|
}
|
||||||
strcpy( i->token, temptoken );
|
Q_strncpyz( i->token, temptoken, sizeof( i->token ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1198,7 +1198,7 @@ int TikiScript::LinesInFile( void )
|
||||||
temp_tokenready = tokenready;
|
temp_tokenready = tokenready;
|
||||||
temp_script_p = script_p;
|
temp_script_p = script_p;
|
||||||
temp_line = line;
|
temp_line = line;
|
||||||
strcpy( temp_token, token );
|
Q_strncpyz( temp_token, token, sizeof( temp_token ) );
|
||||||
|
|
||||||
numentries = 0;
|
numentries = 0;
|
||||||
|
|
||||||
|
@ -1212,7 +1212,7 @@ int TikiScript::LinesInFile( void )
|
||||||
tokenready = temp_tokenready;
|
tokenready = temp_tokenready;
|
||||||
script_p = temp_script_p;
|
script_p = temp_script_p;
|
||||||
line = temp_line;
|
line = temp_line;
|
||||||
strcpy( token, temp_token );
|
Q_strncpyz( token, temp_token, sizeof( token ) );
|
||||||
|
|
||||||
return numentries;
|
return numentries;
|
||||||
}
|
}
|
||||||
|
@ -1307,7 +1307,7 @@ void TikiScript::MarkPos( void )
|
||||||
{
|
{
|
||||||
mark[ mark_pos ].mark_script_p = script_p;
|
mark[ mark_pos ].mark_script_p = script_p;
|
||||||
mark[ mark_pos ].mark_tokenready = tokenready;
|
mark[ mark_pos ].mark_tokenready = tokenready;
|
||||||
strcpy( mark[ mark_pos ].mark_token, token );
|
Q_strncpyz( mark[ mark_pos ].mark_token, token, sizeof(mark[ mark_pos ].mark_token));
|
||||||
mark_pos++;
|
mark_pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -929,7 +929,7 @@ image_t* R_CreateImage(
|
||||||
image->dynamicallyUpdated = dynamicallyUpdated;
|
image->dynamicallyUpdated = dynamicallyUpdated;
|
||||||
image->force32bit = force32bit;
|
image->force32bit = force32bit;
|
||||||
|
|
||||||
strcpy (image->imgName, name);
|
Q_strncpyz (image->imgName, name, sizeof(image->imgName));
|
||||||
|
|
||||||
image->width = width;
|
image->width = width;
|
||||||
image->height = height;
|
image->height = height;
|
||||||
|
@ -2491,7 +2491,7 @@ static void R_LoadImage(const char* name, byte** pic, int* width, int* height, q
|
||||||
|
|
||||||
if (scr_initialized)
|
if (scr_initialized)
|
||||||
{
|
{
|
||||||
sprintf(tempName, "n%s", name);
|
Com_sprintf(tempName, sizeof(tempName), "n%s", name);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ static qhandle_t R_RegisterModelInternal( const char *name, qboolean bBeginTiki,
|
||||||
if( !stricmp( ptr, "spr" ) )
|
if( !stricmp( ptr, "spr" ) )
|
||||||
{
|
{
|
||||||
mod->d.sprite = SPR_RegisterSprite( name );
|
mod->d.sprite = SPR_RegisterSprite( name );
|
||||||
strcpy( mod->name, name );
|
Q_strncpyz( mod->name, name, sizeof( mod->name ) );
|
||||||
|
|
||||||
if( mod->d.sprite )
|
if( mod->d.sprite )
|
||||||
{
|
{
|
||||||
|
@ -230,7 +230,7 @@ static qhandle_t R_RegisterModelInternal( const char *name, qboolean bBeginTiki,
|
||||||
else if( !stricmp( ptr, "tik" ) )
|
else if( !stricmp( ptr, "tik" ) )
|
||||||
{
|
{
|
||||||
mod->d.tiki = TIKI_RegisterTikiFlags( name, use );
|
mod->d.tiki = TIKI_RegisterTikiFlags( name, use );
|
||||||
strcpy( mod->name, name );
|
Q_strncpyz( mod->name, name, sizeof( mod->name ) );
|
||||||
|
|
||||||
if( mod->d.tiki )
|
if( mod->d.tiki )
|
||||||
{
|
{
|
||||||
|
@ -315,7 +315,7 @@ void R_ModelInit( void ) {
|
||||||
tr.numModels = 0;
|
tr.numModels = 0;
|
||||||
|
|
||||||
mod = R_AllocModel();
|
mod = R_AllocModel();
|
||||||
strcpy( mod->name, "** BAD MODEL **" );
|
Q_strncpyz( mod->name, "** BAD MODEL **", sizeof( mod->name ) );
|
||||||
mod->type = MOD_BAD;
|
mod->type = MOD_BAD;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(tr.skel_index) / sizeof(tr.skel_index[0]); i++) {
|
for (i = 0; i < sizeof(tr.skel_index) / sizeof(tr.skel_index[0]); i++) {
|
||||||
|
@ -533,7 +533,7 @@ int GetToolLodCutoff( skelHeaderGame_t *skelmodel, float lod_val ) {
|
||||||
if( lod_save->integer == 1 )
|
if( lod_save->integer == 1 )
|
||||||
{
|
{
|
||||||
Cvar_Set( "lod_save", "0" );
|
Cvar_Set( "lod_save", "0" );
|
||||||
strcpy( lodPath, GetModelPath( skelmodel ) );
|
Q_strncpyz( lodPath, GetModelPath( skelmodel ), sizeof( lodPath ) );
|
||||||
ext = strstr( lodPath, "skd" );
|
ext = strstr( lodPath, "skd" );
|
||||||
strcpy( ext, "lod" );
|
strcpy( ext, "lod" );
|
||||||
SaveLODFile( lodPath, LOD );
|
SaveLODFile( lodPath, LOD );
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ void R_Sphere_InitLights()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(s_sun.szFlareName, COM_Parse((char **)&ents));
|
Q_strncpyz(s_sun.szFlareName, COM_Parse((char **)&ents), sizeof(s_sun.szFlareName));
|
||||||
} else if (!strcmp(ret, "ambientlight")) {
|
} else if (!strcmp(ret, "ambientlight")) {
|
||||||
if (bWorldProcessed) {
|
if (bWorldProcessed) {
|
||||||
ri.Printf(PRINT_WARNING, "Multiple ambientlights defined in map\n");
|
ri.Printf(PRINT_WARNING, "Multiple ambientlights defined in map\n");
|
||||||
|
@ -1279,7 +1279,7 @@ void R_Sphere_InitLights()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_sun.exists && !s_sun.szFlareName[0]) {
|
if (s_sun.exists && !s_sun.szFlareName[0]) {
|
||||||
strcpy(s_sun.szFlareName, "sun");
|
Q_strncpyz(s_sun.szFlareName, "sun", sizeof(s_sun.szFlareName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,9 +81,9 @@ void R_InitStaticModels(void)
|
||||||
AngleVectorsLeft(pSM->angles, pSM->axis[0], pSM->axis[1], pSM->axis[2]);
|
AngleVectorsLeft(pSM->angles, pSM->axis[0], pSM->axis[1], pSM->axis[2]);
|
||||||
|
|
||||||
if (!strnicmp(pSM->model, "models", 6)) {
|
if (!strnicmp(pSM->model, "models", 6)) {
|
||||||
strcpy(szTemp, pSM->model);
|
Q_strncpyz(szTemp, pSM->model, sizeof(szTemp));
|
||||||
} else {
|
} else {
|
||||||
sprintf(szTemp, "models/%s", pSM->model);
|
Com_sprintf(szTemp, sizeof(szTemp), "models/%s", pSM->model);
|
||||||
}
|
}
|
||||||
|
|
||||||
FS_CanonicalFilename(szTemp);
|
FS_CanonicalFilename(szTemp);
|
||||||
|
|
|
@ -262,7 +262,7 @@ void R_DrawDebugNumber( const vec3_t org, float number, float scale, float r, fl
|
||||||
VectorScale(right, scale, right);
|
VectorScale(right, scale, right);
|
||||||
|
|
||||||
if (precision > 0) {
|
if (precision > 0) {
|
||||||
sprintf(format, "%%.%df", precision);
|
Com_sprintf(format, sizeof(format), "%%.%df", precision);
|
||||||
text = va(format, number);
|
text = va(format, number);
|
||||||
} else {
|
} else {
|
||||||
text = va("%d", (int)number);
|
text = va("%d", (int)number);
|
||||||
|
|
|
@ -1455,7 +1455,7 @@ void ScriptCompiler::CompileError(unsigned int sourcePos, const char *format, ..
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
compileSuccess = false;
|
compileSuccess = false;
|
||||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
// scriptexception.cpp : Script Exception
|
// scriptexception.cpp : Script Exception
|
||||||
|
|
||||||
#include "scriptexception.h"
|
#include "scriptexception.h"
|
||||||
|
#include "q_shared.h"
|
||||||
|
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ ScriptException::ScriptException(const char *format, ...)
|
||||||
char data[4100];
|
char data[4100];
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(data, format, va);
|
Q_vsnprintf(data, sizeof(data), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
CreateException(data);
|
CreateException(data);
|
||||||
|
@ -67,7 +68,7 @@ void Error(const char *format, ...)
|
||||||
char data[4100];
|
char data[4100];
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(data, format, va);
|
Q_vsnprintf(data, sizeof(data), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
throw ScriptException((const char *)data);
|
throw ScriptException((const char *)data);
|
||||||
|
|
|
@ -417,7 +417,7 @@ void ScriptVM::error(const char *format, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, format);
|
va_start(va, format);
|
||||||
vsprintf(buffer, format, va);
|
Q_vsnprintf(buffer, sizeof(buffer), format, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
gi.Printf("----------------------------------------------------------\n%s\n", buffer);
|
gi.Printf("----------------------------------------------------------\n%s\n", buffer);
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void SV_Map_f( void ) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy( map, mapname );
|
Q_strncpyz( map, mapname, sizeof( map ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure the level exists before trying to change, so that
|
// make sure the level exists before trying to change, so that
|
||||||
|
@ -284,7 +284,7 @@ static void SV_GameMap_f( void ) {
|
||||||
map = Cmd_Argv( 1 );
|
map = Cmd_Argv( 1 );
|
||||||
Com_DPrintf( "SV_GameMap(%s)\n", map );
|
Com_DPrintf( "SV_GameMap(%s)\n", map );
|
||||||
|
|
||||||
strcpy( svs.gameName, "current" );
|
Q_strncpyz( svs.gameName, "current", sizeof( svs.gameName ) );
|
||||||
Cvar_SaveGameRestart_f();
|
Cvar_SaveGameRestart_f();
|
||||||
|
|
||||||
bTransition = sv.state == SS_GAME;
|
bTransition = sv.state == SS_GAME;
|
||||||
|
@ -1274,7 +1274,7 @@ static void SV_ConSay_f(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (text, "console: ");
|
Q_strncpyz (text, "console: ", sizeof(text));
|
||||||
p = Cmd_Args();
|
p = Cmd_Args();
|
||||||
|
|
||||||
if ( *p == '"' ) {
|
if ( *p == '"' ) {
|
||||||
|
@ -1314,7 +1314,7 @@ static void SV_ConTell_f(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (text, "(private) console: ");
|
Q_strncpyz(text, "(private) console: ", sizeof(text));
|
||||||
p = Cmd_ArgsFrom(2);
|
p = Cmd_ArgsFrom(2);
|
||||||
|
|
||||||
if ( *p == '"' ) {
|
if ( *p == '"' ) {
|
||||||
|
@ -1380,7 +1380,7 @@ static void SV_ConSayto_f(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (text, "(private) console: ");
|
Q_strncpyz(text, "(private) console: ", sizeof(text));
|
||||||
p = Cmd_ArgsFrom(2);
|
p = Cmd_ArgsFrom(2);
|
||||||
|
|
||||||
if ( *p == '"' ) {
|
if ( *p == '"' ) {
|
||||||
|
@ -1584,8 +1584,8 @@ static void SV_TIKI_f( void ) {
|
||||||
if(TIKI_RegisterModel(fname)==0)
|
if(TIKI_RegisterModel(fname)==0)
|
||||||
{
|
{
|
||||||
char tmp[128];
|
char tmp[128];
|
||||||
strcpy(tmp,"models/");
|
Q_strncpyz(tmp,"models/",sizeof(tmp));
|
||||||
strcat(tmp,fname);
|
Q_strcat(tmp,sizeof(tmp),fname);
|
||||||
TIKI_RegisterModel(tmp);
|
TIKI_RegisterModel(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1606,8 +1606,8 @@ static void SV_TIKI_DumpBones_f( void ) {
|
||||||
if(tiki==0)
|
if(tiki==0)
|
||||||
{
|
{
|
||||||
char tmp[128];
|
char tmp[128];
|
||||||
strcpy(tmp,"models/");
|
Q_strncpyz(tmp,"models/",sizeof(tmp));
|
||||||
strcat(tmp,fname);
|
Q_strcat(tmp,sizeof(tmp),fname);
|
||||||
tiki = TIKI_RegisterModel(tmp);
|
tiki = TIKI_RegisterModel(tmp);
|
||||||
if(!tiki)
|
if(!tiki)
|
||||||
return;
|
return;
|
||||||
|
@ -1768,7 +1768,7 @@ SV_HudDrawShader
|
||||||
void SV_HudDrawShader( int iInfo, char *name )
|
void SV_HudDrawShader( int iInfo, char *name )
|
||||||
{
|
{
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
strcpy( cls.HudDrawElements[ iInfo ].shaderName, name );
|
Q_strncpyz( cls.HudDrawElements[ iInfo ].shaderName, name, sizeof(cls.HudDrawElements[ iInfo ].shaderName) );
|
||||||
cls.HudDrawElements[ iInfo ].string[ 0 ] = 0;
|
cls.HudDrawElements[ iInfo ].string[ 0 ] = 0;
|
||||||
cls.HudDrawElements[ iInfo ].pFont = NULL;
|
cls.HudDrawElements[ iInfo ].pFont = NULL;
|
||||||
cls.HudDrawElements[ iInfo ].fontName[ 0 ] = 0;
|
cls.HudDrawElements[ iInfo ].fontName[ 0 ] = 0;
|
||||||
|
@ -1852,7 +1852,7 @@ void SV_HudDrawString( int iInfo, const char *string )
|
||||||
{
|
{
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
cls.HudDrawElements[ iInfo ].hShader = 0;
|
cls.HudDrawElements[ iInfo ].hShader = 0;
|
||||||
strcpy( cls.HudDrawElements[ iInfo ].string, string );
|
Q_strncpyz( cls.HudDrawElements[ iInfo ].string, string, sizeof(cls.HudDrawElements[iInfo].string) );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1864,7 +1864,7 @@ SV_HudDrawFont
|
||||||
void SV_HudDrawFont( int iInfo, const char *name )
|
void SV_HudDrawFont( int iInfo, const char *name )
|
||||||
{
|
{
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
strcpy( cls.HudDrawElements[ iInfo ].fontName, name );
|
Q_strncpyz( cls.HudDrawElements[ iInfo ].fontName, name, sizeof(cls.HudDrawElements[iInfo].fontName) );
|
||||||
cls.HudDrawElements[ iInfo ].hShader = 0;
|
cls.HudDrawElements[ iInfo ].hShader = 0;
|
||||||
cls.HudDrawElements[ iInfo ].shaderName[ 0 ] = 0;
|
cls.HudDrawElements[ iInfo ].shaderName[ 0 ] = 0;
|
||||||
|
|
||||||
|
@ -2073,7 +2073,7 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
||||||
if( strstr( name, "quick.ssv" ) ) {
|
if( strstr( name, "quick.ssv" ) ) {
|
||||||
Com_sprintf( save.comment, sizeof( save.comment ), "QuickSave - %s", comment );
|
Com_sprintf( save.comment, sizeof( save.comment ), "QuickSave - %s", comment );
|
||||||
} else {
|
} else {
|
||||||
strcpy( save.comment, comment );
|
Q_strncpyz( save.comment, comment, sizeof( save.comment ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SV_SetConfigstring( CS_SAVENAME, "" );
|
SV_SetConfigstring( CS_SAVENAME, "" );
|
||||||
|
@ -2083,8 +2083,8 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
||||||
save.flags = 0;
|
save.flags = 0;
|
||||||
|
|
||||||
save.time = aclock;
|
save.time = aclock;
|
||||||
strncpy( save.mapName, svs.mapName, sizeof( save.mapName ) );
|
Q_strncpyz( save.mapName, svs.mapName, sizeof( save.mapName ) );
|
||||||
strncpy( save.saveName, svs.gameName, sizeof( save.saveName ) );
|
Q_strncpyz( save.saveName, svs.gameName, sizeof( save.saveName ) );
|
||||||
save.mapTime = svs.time - svs.startTime;
|
save.mapTime = svs.time - svs.startTime;
|
||||||
|
|
||||||
name = S_GetMusicFilename();
|
name = S_GetMusicFilename();
|
||||||
|
@ -2127,10 +2127,10 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
||||||
|
|
||||||
S_StopAllSounds2( qtrue );
|
S_StopAllSounds2( qtrue );
|
||||||
S_Load( f );
|
S_Load( f );
|
||||||
strncpy( svs.mapName, save.mapName, sizeof( svs.mapName ) );
|
Q_strncpyz( svs.mapName, save.mapName, sizeof( svs.mapName ) );
|
||||||
svs.mapTime = save.mapTime;
|
svs.mapTime = save.mapTime;
|
||||||
svs.areabits_warning_time = 0;
|
svs.areabits_warning_time = 0;
|
||||||
strcpy( svs.tm_filename, save.tm_filename );
|
Q_strncpyz( svs.tm_filename, save.tm_filename, sizeof( svs.tm_filename ) );
|
||||||
svs.tm_loopcount = save.tm_loopcount;
|
svs.tm_loopcount = save.tm_loopcount;
|
||||||
svs.tm_offset = save.tm_offset;
|
svs.tm_offset = save.tm_offset;
|
||||||
FS_FCloseFile( f );
|
FS_FCloseFile( f );
|
||||||
|
@ -2198,7 +2198,7 @@ void SV_Loadgame_f( void )
|
||||||
Com_Printf( "Bad savedir.\n" );
|
Com_Printf( "Bad savedir.\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( svs.gameName, name );
|
Q_strncpyz( svs.gameName, name, sizeof( svs.gameName ) );
|
||||||
archive_name = Com_GetArchiveFileName( name, "sav" );
|
archive_name = Com_GetArchiveFileName( name, "sav" );
|
||||||
Cvar_SaveGameRestart_f();
|
Cvar_SaveGameRestart_f();
|
||||||
|
|
||||||
|
@ -2352,11 +2352,11 @@ void SV_SaveGame( const char *gamename, qboolean autosave )
|
||||||
|
|
||||||
if( gamename )
|
if( gamename )
|
||||||
{
|
{
|
||||||
strcpy( name, gamename );
|
Q_strncpyz( name, gamename, sizeof( name ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy( mname, svs.mapName );
|
Q_strncpyz( mname, svs.mapName, sizeof( mname ) );
|
||||||
for( ptr = strchr( mname, '/' ); ptr != NULL; ptr = strchr( mname, '/' ) )
|
for( ptr = strchr( mname, '/' ); ptr != NULL; ptr = strchr( mname, '/' ) )
|
||||||
{
|
{
|
||||||
*ptr = '_';
|
*ptr = '_';
|
||||||
|
@ -2377,7 +2377,7 @@ void SV_SaveGame( const char *gamename, qboolean autosave )
|
||||||
Com_Printf( "...\n" );
|
Com_Printf( "...\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( svs.gameName, name );
|
Q_strncpyz( svs.gameName, name, sizeof( svs.gameName ) );
|
||||||
|
|
||||||
if (!SV_ArchiveLevelFile(qfalse, autosave)) {
|
if (!SV_ArchiveLevelFile(qfalse, autosave)) {
|
||||||
if (cls.savedCgameState) {
|
if (cls.savedCgameState) {
|
||||||
|
@ -2390,7 +2390,7 @@ void SV_SaveGame( const char *gamename, qboolean autosave )
|
||||||
|
|
||||||
Com_Printf( "Done.\n" );
|
Com_Printf( "Done.\n" );
|
||||||
|
|
||||||
strcpy( svs.gameName, "current" );
|
Q_strncpyz( svs.gameName, "current", sizeof( svs.gameName ) );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2418,7 +2418,7 @@ void SV_Savegame_f( void )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( savegame_name, s );
|
Q_strncpyz( savegame_name, s, sizeof( savegame_name ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1410,7 +1410,7 @@ void PF_centerprintf( gentity_t *ent, const char *fmt, ... )
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start( va, fmt );
|
va_start( va, fmt );
|
||||||
vsprintf( msg, fmt, va );
|
Q_vsnprintf( msg, sizeof( msg ), fmt, va );
|
||||||
va_end( va );
|
va_end( va );
|
||||||
|
|
||||||
if( strlen( msg ) > 256 ) {
|
if( strlen( msg ) > 256 ) {
|
||||||
|
@ -1436,7 +1436,7 @@ void PF_locationprintf( gentity_t *ent, int x, int y, const char *fmt, ... )
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start( va, fmt );
|
va_start( va, fmt );
|
||||||
vsprintf( msg, fmt, va );
|
Q_vsnprintf( msg, sizeof( msg ), fmt, va );
|
||||||
va_end( va );
|
va_end( va );
|
||||||
|
|
||||||
if( strlen( msg ) > 256 ) {
|
if( strlen( msg ) > 256 ) {
|
||||||
|
|
|
@ -212,8 +212,8 @@ int SV_SoundIndex( const char *name, qboolean streamed )
|
||||||
{
|
{
|
||||||
char buf[ 1024 ];
|
char buf[ 1024 ];
|
||||||
|
|
||||||
strcpy( buf, name );
|
Q_strncpyz( buf, name, sizeof(buf) );
|
||||||
strcat( buf, va( "%d", streamed ) );
|
Q_strcat( buf, sizeof(buf), va( "%d", streamed ) );
|
||||||
|
|
||||||
return SV_FindIndex( buf, CS_SOUNDS, MAX_SOUNDS, qtrue );
|
return SV_FindIndex( buf, CS_SOUNDS, MAX_SOUNDS, qtrue );
|
||||||
}
|
}
|
||||||
|
@ -602,7 +602,7 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy( mapname, server );
|
Q_strncpyz( mapname, server, sizeof(mapname) );
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy( svs.mapName, mapname, sizeof( svs.mapName ) );
|
strncpy( svs.mapName, mapname, sizeof( svs.mapName ) );
|
||||||
|
@ -927,7 +927,7 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( svs.gameName, "current" );
|
Q_strncpyz(svs.gameName, "current", sizeof(svs.gameName) );
|
||||||
|
|
||||||
iEnd = Sys_Milliseconds();
|
iEnd = Sys_Milliseconds();
|
||||||
Com_Printf( "------ Server Initialization Complete ------ %5.2f seconds\n", ( float )iEnd / 1000.0f );
|
Com_Printf( "------ Server Initialization Complete ------ %5.2f seconds\n", ( float )iEnd / 1000.0f );
|
||||||
|
@ -1072,7 +1072,7 @@ void SV_Init (void)
|
||||||
#endif
|
#endif
|
||||||
sv_banFile = Cvar_Get("sv_banFile", "serverbans.dat", CVAR_ARCHIVE);
|
sv_banFile = Cvar_Get("sv_banFile", "serverbans.dat", CVAR_ARCHIVE);
|
||||||
|
|
||||||
strcpy( svs.gameName, "current" );
|
Q_strncpyz( svs.gameName, "current", sizeof(svs.gameName) );
|
||||||
|
|
||||||
// dday vars
|
// dday vars
|
||||||
Cvar_Get( "g_ddayfodderguys", "0", CVAR_ARCHIVE );
|
Cvar_Get( "g_ddayfodderguys", "0", CVAR_ARCHIVE );
|
||||||
|
|
|
@ -493,7 +493,7 @@ void SVC_Status( netadr_t from ) {
|
||||||
if(strlen(Cmd_Argv(1)) > 128)
|
if(strlen(Cmd_Argv(1)) > 128)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strcpy( infostring, Cvar_InfoString( CVAR_SERVERINFO ) );
|
Q_strncpyz( infostring, Cvar_InfoString( CVAR_SERVERINFO ), sizeof( infostring ) );
|
||||||
|
|
||||||
// echo back the parameter to status. so master servers can use it as a challenge
|
// echo back the parameter to status. so master servers can use it as a challenge
|
||||||
// to prevent timed spoofed reply packets that add ghost servers
|
// to prevent timed spoofed reply packets that add ghost servers
|
||||||
|
@ -514,7 +514,7 @@ void SVC_Status( netadr_t from ) {
|
||||||
if (statusLength + playerLength >= sizeof(status) ) {
|
if (statusLength + playerLength >= sizeof(status) ) {
|
||||||
break; // can't hold any more
|
break; // can't hold any more
|
||||||
}
|
}
|
||||||
strcpy (status + statusLength, player);
|
Q_strncpyz (status + statusLength, player, sizeof(status) - statusLength);
|
||||||
statusLength += playerLength;
|
statusLength += playerLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ void SV_ClearWorld( void ) {
|
||||||
num = CM_NumInlineModels();
|
num = CM_NumInlineModels();
|
||||||
for( i = 1; i < num; i++ )
|
for( i = 1; i < num; i++ )
|
||||||
{
|
{
|
||||||
sprintf( name, "*%i", i );
|
Com_sprintf( name, sizeof( name ), "*%i", i );
|
||||||
SV_ModelIndex( name );
|
SV_ModelIndex( name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ void ChannelNameTable::CopyChannel(ChannelName_t *dest, const ChannelName_t *sou
|
||||||
|
|
||||||
void ChannelNameTable::SetChannelName(ChannelName_t *channel, const char *newName)
|
void ChannelNameTable::SetChannelName(ChannelName_t *channel, const char *newName)
|
||||||
{
|
{
|
||||||
strcpy(channel->name, newName);
|
Q_strncpyz(channel->name, newName, sizeof(channel->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
ChannelNameTable::ChannelNameTable()
|
ChannelNameTable::ChannelNameTable()
|
||||||
|
|
|
@ -32,7 +32,7 @@ void Skel_DPrintf(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
Com_DPrintf("%s", msg);
|
Com_DPrintf("%s", msg);
|
||||||
|
|
|
@ -31,7 +31,7 @@ void SKEL_Message(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ void SKEL_Warning(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ void SKEL_Error(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
Skel_DPrintf(msg);
|
Skel_DPrintf(msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ void Sys_LaunchAutoupdater(int argc, char **argv)
|
||||||
memset(&procinfo, '\0', sizeof (procinfo));
|
memset(&procinfo, '\0', sizeof (procinfo));
|
||||||
memset(&startinfo, '\0', sizeof (startinfo));
|
memset(&startinfo, '\0', sizeof (startinfo));
|
||||||
startinfo.cb = sizeof (startinfo);
|
startinfo.cb = sizeof (startinfo);
|
||||||
sprintf(cmdline, "" AUTOUPDATER_BIN " --waitpid %u", (unsigned int) GetCurrentProcessId());
|
Com_sprintf(cmdline, sizeof(cmdline), "" AUTOUPDATER_BIN " --waitpid %u", (unsigned int) GetCurrentProcessId());
|
||||||
|
|
||||||
if (CreateProcessA(AUTOUPDATER_BIN, cmdline, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startinfo, &procinfo))
|
if (CreateProcessA(AUTOUPDATER_BIN, cmdline, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startinfo, &procinfo))
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,7 +75,7 @@ cLocalization::cLocalization()
|
||||||
size_t iBasePos;
|
size_t iBasePos;
|
||||||
|
|
||||||
ppszFiles = FS_ListFilteredFiles( "global", "txt", "localization*.txt", qfalse, &iFileCount, qtrue );
|
ppszFiles = FS_ListFilteredFiles( "global", "txt", "localization*.txt", qfalse, &iFileCount, qtrue );
|
||||||
strcpy( szFilename, "global/" );
|
Q_strncpyz( szFilename, "global/", sizeof( szFilename ) );
|
||||||
memset( szFilename + 8, 0, sizeof( szFilename ) - 8 );
|
memset( szFilename + 8, 0, sizeof( szFilename ) - 8 );
|
||||||
iBasePos = strlen( szFilename );
|
iBasePos = strlen( szFilename );
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ cLocalization::cLocalization()
|
||||||
qsort( ppszFiles, iFileCount, sizeof( char * ), compare_strings );
|
qsort( ppszFiles, iFileCount, sizeof( char * ), compare_strings );
|
||||||
for( i = 0; i < iFileCount; i++ )
|
for( i = 0; i < iFileCount; i++ )
|
||||||
{
|
{
|
||||||
strcpy( szFilename + iBasePos, ppszFiles[ i ] );
|
Q_strncpyz( szFilename + iBasePos, ppszFiles[ i ], sizeof( szFilename ) - iBasePos );
|
||||||
Com_Printf( "--- Localization: reading file %s\n", szFilename );
|
Com_Printf( "--- Localization: reading file %s\n", szFilename );
|
||||||
LoadFile( szFilename );
|
LoadFile( szFilename );
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ dtikianim_t *TIKI_RegisterTikiAnimFlags(const char *path, qboolean use)
|
||||||
dtikianim_t *tiki;
|
dtikianim_t *tiki;
|
||||||
char filename[1024];
|
char filename[1024];
|
||||||
|
|
||||||
strcpy(filename, path);
|
Q_strncpyz(filename, path, sizeof(filename));
|
||||||
FS_CanonicalFilename(filename);
|
FS_CanonicalFilename(filename);
|
||||||
|
|
||||||
if (tikianimcache) {
|
if (tikianimcache) {
|
||||||
|
@ -182,9 +182,9 @@ dtiki_t *TIKI_RegisterTikiFlags(const char *path, qboolean use)
|
||||||
strcat(full_filename, "|");
|
strcat(full_filename, "|");
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(filename, name);
|
Q_strncpyz(filename, name, sizeof(filename));
|
||||||
FS_CanonicalFilename(filename);
|
FS_CanonicalFilename(filename);
|
||||||
strcat(full_filename, filename);
|
Q_strcat(full_filename, sizeof(full_filename), filename);
|
||||||
|
|
||||||
if (!tikicache) {
|
if (!tikicache) {
|
||||||
tikicache = new con_map<pchar, dtiki_t *>;
|
tikicache = new con_map<pchar, dtiki_t *>;
|
||||||
|
|
|
@ -256,14 +256,14 @@ dtikianim_t *TIKI_LoadTikiAnim(const char *path)
|
||||||
|
|
||||||
TIKI_AddDefaultIdleAnim(&loaddef);
|
TIKI_AddDefaultIdleAnim(&loaddef);
|
||||||
if (loaddef.numanims) {
|
if (loaddef.numanims) {
|
||||||
sprintf(tempName, "a%s", path);
|
Com_sprintf(tempName, sizeof(tempName), "a%s", path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
tiki = TIKI_FillTIKIStructureSkel(&loaddef);
|
tiki = TIKI_FillTIKIStructureSkel(&loaddef);
|
||||||
if (tiki) {
|
if (tiki) {
|
||||||
sprintf(tempName, "b%s", path);
|
Com_sprintf(tempName, sizeof(tempName), "b%s", path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
sprintf(tempName, "c%s", path);
|
Com_sprintf(tempName, sizeof(tempName), "c%s", path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
VectorSubtract(tiki->maxs, tiki->mins, tempVec);
|
VectorSubtract(tiki->maxs, tiki->mins, tempVec);
|
||||||
|
@ -273,7 +273,7 @@ dtikianim_t *TIKI_LoadTikiAnim(const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
TIKI_FreeStorage(&loaddef);
|
TIKI_FreeStorage(&loaddef);
|
||||||
sprintf(tempName, "d%s", path);
|
Com_sprintf(tempName, sizeof(tempName), "d%s", path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
} else {
|
} else {
|
||||||
TIKI_FreeStorage(&loaddef);
|
TIKI_FreeStorage(&loaddef);
|
||||||
|
@ -539,8 +539,8 @@ skelAnimDataGameHeader_t *SkeletorCacheFileCallback(const char *path)
|
||||||
Com_DPrintf("Skeletor CacheAnimSkel: %s: File extension unknown. Attempting to open as skc file\n", path);
|
Com_DPrintf("Skeletor CacheAnimSkel: %s: File extension unknown. Attempting to open as skc file\n", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(npath, "newanim/");
|
Q_strncpyz(npath, "newanim/", sizeof(npath));
|
||||||
strcat(npath, path);
|
Q_strcat(npath, sizeof(npath), path);
|
||||||
|
|
||||||
iBuffLength = TIKI_ReadFileEx(npath, (void **)&buffer, qtrue);
|
iBuffLength = TIKI_ReadFileEx(npath, (void **)&buffer, qtrue);
|
||||||
if (iBuffLength > 0) {
|
if (iBuffLength > 0) {
|
||||||
|
@ -714,7 +714,7 @@ bool SkeletorCacheLoadData(const char *path, bool precache, int newIndex)
|
||||||
m_cachedDataLookup[newIndex] = lookup;
|
m_cachedDataLookup[newIndex] = lookup;
|
||||||
m_cachedData[lookup].lookup = newIndex;
|
m_cachedData[lookup].lookup = newIndex;
|
||||||
m_cachedData[lookup].data = data;
|
m_cachedData[lookup].data = data;
|
||||||
strcpy(m_cachedData[lookup].path, path);
|
Q_strncpyz(m_cachedData[lookup].path, path, sizeof(m_cachedData[lookup].path));
|
||||||
m_cachedData[lookup].numusers = 0;
|
m_cachedData[lookup].numusers = 0;
|
||||||
m_numInCache++;
|
m_numInCache++;
|
||||||
|
|
||||||
|
@ -985,7 +985,7 @@ dtikianim_t *TIKI_InitTiki(dloaddef_t *ld, size_t defsize)
|
||||||
ptr += sizeof(dtikianimdef_t);
|
ptr += sizeof(dtikianimdef_t);
|
||||||
panim->animdefs[i] = panimdef;
|
panim->animdefs[i] = panimdef;
|
||||||
panim->m_aliases[i] = alias_index;
|
panim->m_aliases[i] = alias_index;
|
||||||
strcpy(panimdef->alias, anim->alias);
|
Q_strncpyz(panimdef->alias, anim->alias, sizeof(panimdef->alias));
|
||||||
panimdef->weight = anim->weight;
|
panimdef->weight = anim->weight;
|
||||||
panimdef->flags = anim->flags;
|
panimdef->flags = anim->flags;
|
||||||
|
|
||||||
|
@ -1093,7 +1093,7 @@ dtikianim_t *TIKI_InitTiki(dloaddef_t *ld, size_t defsize)
|
||||||
memcpy(panim->headskins, ld->headskins, size);
|
memcpy(panim->headskins, ld->headskins, size);
|
||||||
ptr += size;
|
ptr += size;
|
||||||
|
|
||||||
sprintf(tempName, "h%s", ld->path);
|
Com_sprintf(tempName, sizeof(tempName), "h%s", ld->path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
if (low_anim_memory && (!low_anim_memory->integer || !tiki_loading)) {
|
if (low_anim_memory && (!low_anim_memory->integer || !tiki_loading)) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ void TIKI_DPrintf(const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(msg, fmt, va);
|
Q_vsnprintf(msg, sizeof(msg), fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
Com_DPrintf("%s", msg);
|
Com_DPrintf("%s", msg);
|
||||||
|
|
|
@ -150,7 +150,7 @@ void TIKI_ParseFrameCommands(dloaddef_t *ld, dloadframecmd_t **cmdlist, int maxc
|
||||||
|
|
||||||
cmds->frame_num = framenum;
|
cmds->frame_num = framenum;
|
||||||
if (ld->tikiFile.currentScript) {
|
if (ld->tikiFile.currentScript) {
|
||||||
sprintf(cmds->location, "%s, line: %d", ld->tikiFile.Filename(), ld->tikiFile.GetLineNumber());
|
Com_sprintf(cmds->location, sizeof(cmds->location), "%s, line: %d", ld->tikiFile.Filename(), ld->tikiFile.GetLineNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
while (ld->tikiFile.TokenAvailable(false)) {
|
while (ld->tikiFile.TokenAvailable(false)) {
|
||||||
|
@ -468,13 +468,14 @@ void TIKI_ParseAnimations(dloaddef_t *ld)
|
||||||
anim->alias = (char *)TIKI_CopyString(token);
|
anim->alias = (char *)TIKI_CopyString(token);
|
||||||
|
|
||||||
token = ld->tikiFile.GetToken(false);
|
token = ld->tikiFile.GetToken(false);
|
||||||
strcpy(anim->name, TikiScript::currentScript->path);
|
Q_strncpyz(anim->name, TikiScript::currentScript->path, sizeof(anim->name));
|
||||||
strcat(anim->name, token);
|
Q_strcat(anim->name, sizeof(anim->name), token);
|
||||||
|
|
||||||
anim->location[0] = 0;
|
anim->location[0] = 0;
|
||||||
if (ld->tikiFile.currentScript) {
|
if (ld->tikiFile.currentScript) {
|
||||||
sprintf(
|
Com_sprintf(
|
||||||
anim->location,
|
anim->location,
|
||||||
|
sizeof(anim->location),
|
||||||
"%s, line: %d",
|
"%s, line: %d",
|
||||||
ld->tikiFile.currentScript->Filename(),
|
ld->tikiFile.currentScript->Filename(),
|
||||||
ld->tikiFile.currentScript->GetLineNumber()
|
ld->tikiFile.currentScript->GetLineNumber()
|
||||||
|
@ -890,7 +891,7 @@ qboolean TIKI_LoadSetupCase(
|
||||||
loadsurfaces[currentSurface].flags = 0;
|
loadsurfaces[currentSurface].flags = 0;
|
||||||
(*numSurfacesSetUp)++;
|
(*numSurfacesSetUp)++;
|
||||||
}
|
}
|
||||||
strcpy(loadsurfaces[currentSurface].name, name);
|
Q_strncpyz(loadsurfaces[currentSurface].name, name, sizeof(loadsurfaces[currentSurface].name));
|
||||||
break;
|
break;
|
||||||
case SETUP_FLAGS:
|
case SETUP_FLAGS:
|
||||||
flags = MSG_ReadLong(msg);
|
flags = MSG_ReadLong(msg);
|
||||||
|
@ -1031,17 +1032,17 @@ qboolean TIKI_ParseSetup(dloaddef_t *ld)
|
||||||
WriteLodBias(ld, lod_bias);
|
WriteLodBias(ld, lod_bias);
|
||||||
} else if (!Q_stricmp(token, "skelmodel")) {
|
} else if (!Q_stricmp(token, "skelmodel")) {
|
||||||
token = ld->tikiFile.GetToken(false);
|
token = ld->tikiFile.GetToken(false);
|
||||||
strcpy(name, ld->tikiFile.currentScript->path);
|
Q_strncpyz(name, ld->tikiFile.currentScript->path, sizeof(name));
|
||||||
strcat(name, token);
|
Q_strcat(name, sizeof(name), token);
|
||||||
WriteSkelmodel(ld, name);
|
WriteSkelmodel(ld, name);
|
||||||
} else if (!Q_stricmp(token, "path")) {
|
} else if (!Q_stricmp(token, "path")) {
|
||||||
token = ld->tikiFile.GetToken(false);
|
token = ld->tikiFile.GetToken(false);
|
||||||
strcpy(ld->tikiFile.currentScript->path, token);
|
Q_strncpyz(ld->tikiFile.currentScript->path, token, sizeof(name));
|
||||||
length = strlen(ld->tikiFile.currentScript->path);
|
length = strlen(ld->tikiFile.currentScript->path);
|
||||||
token = ld->tikiFile.currentScript->path + length - 1;
|
token = ld->tikiFile.currentScript->path + length - 1;
|
||||||
|
|
||||||
if (*token != '/' && *token != '\\') {
|
if (*token != '/' && *token != '\\') {
|
||||||
strcat(ld->tikiFile.currentScript->path, "/");
|
Q_strcat(ld->tikiFile.currentScript->path, sizeof(ld->tikiFile.currentScript->path), "/");
|
||||||
}
|
}
|
||||||
} else if (!Q_stricmp(token, "orgin")) {
|
} else if (!Q_stricmp(token, "orgin")) {
|
||||||
tmpVec[0] = ld->tikiFile.GetFloat(false);
|
tmpVec[0] = ld->tikiFile.GetFloat(false);
|
||||||
|
@ -1071,8 +1072,8 @@ qboolean TIKI_ParseSetup(dloaddef_t *ld)
|
||||||
} else if (!Q_stricmp(token, "shader")) {
|
} else if (!Q_stricmp(token, "shader")) {
|
||||||
token = ld->tikiFile.GetToken(false);
|
token = ld->tikiFile.GetToken(false);
|
||||||
if (strstr(token, ".")) {
|
if (strstr(token, ".")) {
|
||||||
strcpy(name, ld->tikiFile.currentScript->path);
|
Q_strncpyz(name, ld->tikiFile.currentScript->path, sizeof(name));
|
||||||
strcat(name, token);
|
Q_strcat(name, sizeof(name), token);
|
||||||
WriteShader(ld, name);
|
WriteShader(ld, name);
|
||||||
} else {
|
} else {
|
||||||
WriteShader(ld, token);
|
WriteShader(ld, token);
|
||||||
|
|
|
@ -739,7 +739,7 @@ void GetLODFile(skelcache_t *cache)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(pathLOD, cache->path);
|
Q_strncpyz(pathLOD, cache->path, sizeof(pathLOD));
|
||||||
ext = strstr(pathLOD, "skd");
|
ext = strstr(pathLOD, "skd");
|
||||||
strcpy(ext, "lod");
|
strcpy(ext, "lod");
|
||||||
|
|
||||||
|
@ -1069,7 +1069,7 @@ int TIKI_RegisterSkel(const char *path, dtiki_t *tiki)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(tempName, "l%s", path);
|
Com_sprintf(tempName, sizeof(tempName), "l%s", path);
|
||||||
UI_LoadResource(tempName);
|
UI_LoadResource(tempName);
|
||||||
|
|
||||||
return cache - skelcache;
|
return cache - skelcache;
|
||||||
|
|
|
@ -101,7 +101,7 @@ void UI_SetCvarInt( const char *cvar, int value )
|
||||||
{
|
{
|
||||||
char s[ 16 ];
|
char s[ 16 ];
|
||||||
|
|
||||||
sprintf( s, "%d", value );
|
Com_sprintf( s, sizeof( s ), "%d", value );
|
||||||
uii.Cvar_Set( cvar, s );
|
uii.Cvar_Set( cvar, s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ void UI_SetCvarFloat( const char *cvar, float value )
|
||||||
{
|
{
|
||||||
char s[ 16 ];
|
char s[ 16 ];
|
||||||
|
|
||||||
sprintf( s, "%f", value );
|
Com_sprintf( s, sizeof( s ), "%f", value );
|
||||||
uii.Cvar_Set( cvar, s );
|
uii.Cvar_Set( cvar, s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue