darope@0: // vi: set ts=4 sw=4 : darope@0: // vim: set tw=75 : darope@0: darope@0: // Selected portions of dlls/util.cpp from SDK 2.1. darope@0: // Functions copied from there as needed... darope@0: // And modified to avoid buffer overflows (argh). darope@0: darope@0: /*** darope@0: * darope@0: * Copyright (c) 1999, 2000 Valve LLC. All rights reserved. darope@0: * darope@0: * This product contains software technology licensed from Id darope@0: * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. darope@0: * All Rights Reserved. darope@0: * darope@0: * Use, distribution, and modification of this source code and/or resulting darope@0: * object code is restricted to non-commercial enhancements to products from darope@0: * Valve LLC. All other use, distribution, or modification is prohibited darope@0: * without written permission from Valve LLC. darope@0: * darope@0: ****/ darope@0: /* darope@0: darope@0: ===== util.cpp ======================================================== darope@0: darope@0: Utility code. Really not optional after all. darope@0: darope@0: */ darope@0: darope@0: #include darope@0: #include // ALERT() darope@0: darope@0: #include "osdep.h" // win32 vsnprintf, etc darope@0: darope@0: //========================================================= darope@0: // UTIL_LogPrintf - Prints a logged message to console. darope@0: // Preceded by LOG: ( timestamp ) < message > darope@0: //========================================================= ds@265: void UTIL_LogPrintf( const char *fmt, ... ) darope@0: { darope@0: va_list argptr; darope@0: static char string[1024]; darope@0: darope@0: va_start ( argptr, fmt ); darope@0: vsnprintf ( string, sizeof(string), fmt, argptr ); darope@0: va_end ( argptr ); darope@0: darope@0: // Print to server console darope@0: ALERT( at_logged, "%s", string ); darope@0: }