DatabaseServer Crash

01/17/2020 11:59 LuciferMorningStar666#1
Hello y'all, anyone care to help with my problem?
[Only registered and activated users can see links. Click Here To Register...]

Quote:
const char* MakeFileNameDate(const char* lpszFileName)
{
static char szFullFileName[_MAX_PATH + _MAX_FNAME];
::memset(szFullFileName, 0, sizeof(szFullFileName));

#ifdef __CLIENT
//::GetCurrentDirectory( _MAX_PATH, szFullFileName );
strcpy(szFullFileName, g_Option.GetConfigurationPath());
_tcscat_s<_MAX_PATH + _MAX_FNAME>(szFullFileName, "Log\\");
::CreateDirectory(szFullFileName, nullptr);
_tcscat_s<_MAX_PATH + _MAX_FNAME>(szFullFileName, lpszFileName);
#else // __CLIENT
_tcscpy_s<_MAX_PATH + _MAX_FNAME>(szFullFileName, lpszFileName);
#endif // __CLIENT

char* ptr = _tcsrchr(szFullFileName, '.');
if (ptr != nullptr)
{
char szExt[5] = { 0, };
_tcscpy(szExt, ptr);
*ptr = '\0';
char szDate[10] = { 0, };
SYSTEMTIME time;
GetLocalTime(&time);
_stprintf(szDate, "_%d%02d%02d", time.wYear, time.wMonth, time.wDay);
_tcscat_s<_MAX_PATH + _MAX_FNAME>(szFullFileName, szDate);
_tcscat_s<_MAX_PATH + _MAX_FNAME>(szFullFileName, szExt);

return szFullFileName;
}
return lpszFileName;
}
It is crashing here, and by the way thats the seconds codes already that come from Azure release. Here's the original
Quote:
const char* MakeFileNameDate( const char* lpszFileName )
{
static char szFullFileName[_MAX_PATH+_MAX_FNAME];
::memset( szFullFileName, 0, sizeof( szFullFileName ) );

#ifdef __CLIENT
::GetCurrentDirectory( _MAX_PATH, szFullFileName );
_tcscat( szFullFileName, "\\Log\\" );
::CreateDirectory( szFullFileName, NULL );
_tcscat( szFullFileName, lpszFileName );
#else // __CLIENT
_tcscpy( szFullFileName, lpszFileName );
#endif // __CLIENT

char* ptr = _tcsrchr( szFullFileName, '.' );
if( ptr != NULL )
{
char szExt[5] = {0, };
_tcscpy( szExt, ptr );
*ptr = '\0';
char szDate[10] = {0, };
SYSTEMTIME time;
GetLocalTime( &time );
_stprintf( szDate, "_%d%02d%02d", time.wYear, time.wMonth, time.wDay );
_tcscat( szFullFileName, szDate );
_tcscat( szFullFileName, szExt );

return szFullFileName;
}
return lpszFileName;
}