mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-16 08:52:23 +00:00
Nuke yet another stack buffer.
Dn Dn Dn another one's gone, another one's gone, another one bites the dust
This commit is contained in:
parent
e3c5f6e608
commit
86c5b79816
1 changed files with 12 additions and 8 deletions
|
@ -2030,17 +2030,21 @@ SV_UserInit (void)
|
|||
static void
|
||||
OutofBandPrintf (netadr_t where, const char *fmt, ...)
|
||||
{
|
||||
char send[1024];
|
||||
// 0 for davsprintf
|
||||
static const char header[] = {0xff, 0xff, 0xff, 0xff, A2C_PRINT, 0};
|
||||
static dstring_t *send = 0;
|
||||
va_list argptr;
|
||||
int len;
|
||||
|
||||
send[0] = 0xff;
|
||||
send[1] = 0xff;
|
||||
send[2] = 0xff;
|
||||
send[3] = 0xff;
|
||||
send[4] = A2C_PRINT;
|
||||
if (!send)
|
||||
send = dstring_new ();
|
||||
send->size = sizeof (header);
|
||||
dstring_adjust (send);
|
||||
memcpy (send->str, header, sizeof (header));
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (send + 5, sizeof (send) - 5, fmt, argptr);
|
||||
davsprintf (send, fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
Netchan_SendPacket (strlen (send) + 1, send, where);
|
||||
len = min (send->size, 1024);
|
||||
Netchan_SendPacket (len, send->str, where);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue