mirror of
https://git.stillkill.net/MinecraftLeak/Mc-cpp-Snapshot.git
synced 2026-10-22 21:32:19 +01:00
Initial commit
This commit is contained in:
commit
a9c1b8fcb6
2100 files changed
+610164
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#include "FormatString.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include "LinuxStrings.h"
|
||||
|
||||
char * FormatString(const char *format, ...)
|
||||
{
|
||||
static int textIndex=0;
|
||||
static char text[4][8096];
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
if (++textIndex==4)
|
||||
textIndex=0;
|
||||
_vsnprintf(text[textIndex], 8096, format, ap);
|
||||
va_end(ap);
|
||||
text[textIndex][8096-1]=0;
|
||||
|
||||
return text[textIndex];
|
||||
}
|
||||
|
||||
char * FormatStringTS(char *output, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
_vsnprintf(output, 512, format, ap);
|
||||
va_end(ap);
|
||||
return output;
|
||||
}
|
||||
Reference in new issue
Block a user