Archived
1
0

REALLY MSVC.

This commit is contained in:
Marrub 2015-08-06 09:07:02 -04:00
parent 6815421294
commit 6188ed3123

View File

@ -423,14 +423,15 @@ 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);
@ -439,6 +440,9 @@ LT_BOOL LT_Assert(LT_BOOL assertion, const char *fmt, ...)
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;