mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-17 01:21:47 +00:00
- Add parameter checking to CL_*Ping* functions.
- Remove unused CL_UpdateServerInfo function
This commit is contained in:
parent
0c662f25f2
commit
cd3e202fca
1 changed files with 4 additions and 19 deletions
|
@ -3783,9 +3783,9 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
|
||||||
int time;
|
int time;
|
||||||
int maxPing;
|
int maxPing;
|
||||||
|
|
||||||
if (!cl_pinglist[n].adr.port)
|
if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
|
||||||
{
|
{
|
||||||
// empty slot
|
// empty or invalid slot
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
*pingtime = 0;
|
*pingtime = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -3815,21 +3815,6 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
|
||||||
*pingtime = time;
|
*pingtime = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
==================
|
|
||||||
CL_UpdateServerInfo
|
|
||||||
==================
|
|
||||||
*/
|
|
||||||
void CL_UpdateServerInfo( int n )
|
|
||||||
{
|
|
||||||
if (!cl_pinglist[n].adr.port)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CL_SetServerInfoByAddress(cl_pinglist[n].adr, cl_pinglist[n].info, cl_pinglist[n].time );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
CL_GetPingInfo
|
CL_GetPingInfo
|
||||||
|
@ -3837,9 +3822,9 @@ CL_GetPingInfo
|
||||||
*/
|
*/
|
||||||
void CL_GetPingInfo( int n, char *buf, int buflen )
|
void CL_GetPingInfo( int n, char *buf, int buflen )
|
||||||
{
|
{
|
||||||
if (!cl_pinglist[n].adr.port)
|
if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
|
||||||
{
|
{
|
||||||
// empty slot
|
// empty or invalid slot
|
||||||
if (buflen)
|
if (buflen)
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue