Cvar_SetValueQuick(&csqc_progsize, -1);
// Host_AbortCurrentFrame(); //[515]: hmmm... if server says it needs csqc then client MUST disconnect
- Host_Error(va("CL_VM_Error: %s", errorstring));
+ Host_Error("CL_VM_Error: %s", errorstring);
}
void CL_VM_UpdateDmgGlobals (int dmg_take, int dmg_save, vec3_t dmg_origin)
{
// Load the central directory in memory
central_dir = (unsigned char *)Mem_Alloc (tempmempool, eocd->cdir_size);
lseek (pack->handle, eocd->cdir_offset, SEEK_SET);
- read (pack->handle, central_dir, eocd->cdir_size);
+ if(read (pack->handle, central_dir, eocd->cdir_size) != eocd->cdir_size)
+ {
+ Mem_Free (central_dir);
+ return -1;
+ }
// Extract the files properties
// The parsing is done "by hand" because some fields have variable sizes and
#endif
if (packhandle < 0)
return NULL;
- read (packhandle, (void *)&header, sizeof(header));
+ if(read (packhandle, (void *)&header, sizeof(header)) != sizeof(header))
+ {
+ Con_Printf ("%s is not a packfile\n", packfile);
+ close(packhandle);
+ return NULL;
+ }
if (memcmp(header.id, "PACK", 4))
{
Con_Printf ("%s is not a packfile\n", packfile);
if(svs.clients[i].active && svs.clients[i].netconnection)
{
host_client = &svs.clients[i];
- Host_ClientCommands(va("sendcvar %s\n", cvarname));
+ Host_ClientCommands("sendcvar %s\n", cvarname);
}
host_client = old;
}
dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
- Con_Printf(msg);
+ Con_Print(msg);
// TODO: either add a cvar/cmd to control the state dumping or replace some of the calls with Con_Printf [9/13/2006 Black]
if(prvm_backtraceforwarnings.integer && recursive != realtime) // NOTE: this compares to the time, just in case if PRVM_PrintState causes a Host_Error and keeps recursive set
Mem_Free(temp);
// calculated crc, send the file info to the client
// (so that it can verify the data)
- Host_ClientCommands(va("\ncl_downloadfinished %i %i %s\n", size, crc, host_client->download_name));
+ Host_ClientCommands("\ncl_downloadfinished %i %i %s\n", size, crc, host_client->download_name);
Con_DPrintf("Download of %s by %s has finished\n", host_client->download_name, host_client->name);
FS_Close(host_client->download_file);
host_client->download_file = NULL;