X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=source%2Fstrformat.cpp;fp=source%2Fstrformat.cpp;h=188b1218626c53e303a5e299462c80a9537aa59f;hp=0000000000000000000000000000000000000000;hb=81f1ddee977603293d0c5710f2db69130dac6a96;hpb=a51c2557622ea93944e24f58845609526eb46ec1 diff --git a/source/strformat.cpp b/source/strformat.cpp new file mode 100644 index 0000000..188b121 --- /dev/null +++ b/source/strformat.cpp @@ -0,0 +1,22 @@ +/* $Id$ + +This file is part of gldbg +Copyright © 2011 Mikko Rasa, Mikkosoft Productions +Distributed under the GPL +*/ + +#include +#include +#include "strformat.h" + +using namespace std; + +string strformat(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + char buf[2048]; + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + return buf; +}