All pastes #67937 Raw Edit

Something

public cpp v1 · immutable
#67937 ·published 2006-06-20 20:19 UTC
rendered paste body
void LogLine(char *formatstring, ...){        char logTimeDate[20];        time_t logNow;        char logFile[128];        time(&logNow);        strftime(logTimeDate,(size_t)19,"%Y%m%d%H%M%S.log",localtime(&logNow));        sprintf(logFile,"dupefile-%s.log",logTimeDate);        va_list args;        va_start(args, formatstring);        char msg[1024];        EnterCriticalSection(&CriticalSection);        memset(msg, 0, sizeof(msg));        FILE *theFile=fopen(logFile,"a+");        // Esta es la linea vieja: FILE *logfile = fopen("dupefinder.log", "a+");        _vsnprintf(msg, sizeof(msg), formatstring, args);        fputs(msg, theFile);        fclose(theFile);        LeaveCriticalSection(&CriticalSection);}