Minor Win vs Linux bugg

This commit is contained in:
Linus_Probert 2018-01-25 08:45:57 +01:00
parent cdefa1e737
commit 574e34ce4b
2 changed files with 7 additions and 5 deletions

View File

@ -190,7 +190,7 @@ gui_render_panel(Gui *gui, unsigned int width, unsigned int height, Camera *cam)
void
gui_log(const char *fmt, ...)
{
char buffer[200];
char buffer[log_data.strlen];
char *new_message;
unsigned int i;
char tstamp[10];
@ -200,7 +200,7 @@ gui_log(const char *fmt, ...)
#ifndef _MSC_VER
vsprintf(buffer, fmt, args);
#else // _MSC_VER
vsprintf_s(buffer, 200, fmt, args);
vsprintf_s(buffer, log_data.strlen, fmt, args);
#endif // _MSC_VER
va_end(args);

View File

@ -127,14 +127,16 @@ timestamp(char *tstamp, size_t sz)
struct tm *tm_info;
time(&cTime);
#ifndef _MSC_VER
tm_info = localtime(&cTime);
#else // _MSC_VER
#ifdef _MSC_VER
tm_info = ec_malloc(sizeof(struct tm));
localtime_s(tm_info, &cTime);
#else // _MSC_VER
tm_info = localtime(&cTime);
#endif // _MSC_VER
strftime(tstamp, sz, "%H:%M:%S", tm_info);
#ifdef _MSC_VER
free(tm_info);
#endif // _MSC_VER
}