REALLY MSVC.
This commit is contained in:
parent
6815421294
commit
6188ed3123
12
src/lt.c
12
src/lt.c
|
@ -423,22 +423,26 @@ LT_BOOL LT_Assert(LT_BOOL assertion, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
if(assertion)
|
if(assertion)
|
||||||
{
|
{
|
||||||
char ftString[16];
|
char *ftString = LT_Malloc(64);
|
||||||
char asBuffer[512];
|
char *asBuffer = LT_Malloc(512);
|
||||||
|
int place = (int)ftell(parseFile);
|
||||||
|
|
||||||
va_list va;
|
va_list va;
|
||||||
assertError = LT_TRUE;
|
assertError = LT_TRUE;
|
||||||
assertString = malloc(512);
|
assertString = malloc(512);
|
||||||
|
|
||||||
sprintf(ftString, ":%d:", (int)ftell(parseFile));
|
sprintf(ftString, "(offset %d)", place);
|
||||||
|
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
vsprintf(asBuffer, fmt, va);
|
vsprintf(asBuffer, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
sprintf(assertString, "%s%s", ftString, asBuffer);
|
sprintf(assertString, "%s %s", ftString, asBuffer);
|
||||||
|
|
||||||
LT_SetGarbage(assertString);
|
LT_SetGarbage(assertString);
|
||||||
|
|
||||||
|
free(ftString);
|
||||||
|
free(asBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return assertion;
|
return assertion;
|
||||||
|
|
Reference in New Issue
Block a user