sourcemod/public/mms_sample_ext/stub_util.cpp
David Anderson ca0da2559d fixed bugs in the external extension system
import of external SDK that's been sitting around for a while

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401674
2007-11-10 05:46:09 +00:00

23 lines
331 B
C++

#include <stdio.h>
#include <stdarg.h>
#include "stub_util.h"
size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
size_t len = vsnprintf(buffer, maxlength, fmt, ap);
va_end(ap);
if (len >= maxlength)
{
len = maxlength - 1;
buffer[len] = '\0';
}
return len;
}