*/
void Cmd_ForwardToServer (void)
{
+ char *s;
if (cls.state != ca_connected)
{
Con_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
if (cls.demoplayback)
return; // not really connected
- MSG_WriteByte (&cls.message, clc_stringcmd);
+ // LordHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
+ // attention, it has been eradicated from here, its only (former) use in
+ // all of darkplaces.
if (strcasecmp(Cmd_Argv(0), "cmd") != 0)
- {
- SZ_Print (&cls.message, Cmd_Argv(0));
- SZ_Print (&cls.message, " ");
- }
- if (Cmd_Argc() > 1)
- SZ_Print (&cls.message, Cmd_Args());
+ s = va("%s %s", Cmd_Argv(0), Cmd_Argc() > 1 ? Cmd_Args() : "\n");
else
- SZ_Print (&cls.message, "\n");
+ s = va("%s", Cmd_Argc() > 1 ? Cmd_Args() : "\n");
+ MSG_WriteByte(&cls.message, clc_stringcmd);
+ SZ_Write(&cls.message, s, strlen(s) + 1);
}
memcpy (SZ_GetSpace(buf,length),data,length);
}
-void SZ_Print (sizebuf_t *buf, const char *data)
-{
- int len;
- len = strlen(data)+1;
-
-// byte * cast to keep VC++ happy
- if (buf->data[buf->cursize-1])
- memcpy ((qbyte *)SZ_GetSpace(buf, len),data,len); // no trailing 0
- else
- memcpy ((qbyte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
-}
+// LordHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
+// attention, it has been eradicated from here, its only (former) use in
+// all of darkplaces.
static char *hexchar = "0123456789ABCDEF";
void Com_HexDumpToConsole(const qbyte *data, int size)