core/smn_core.cpp
changeset 1359 c93c61f32568
parent 1334 9db842b7a9fe
child 1371 d207f0e17532
     1.1 --- a/core/smn_core.cpp	Sun Aug 19 15:47:53 2007 +0000
     1.2 +++ b/core/smn_core.cpp	Sun Aug 19 16:54:06 2007 +0000
     1.3 @@ -48,6 +48,7 @@
     1.4  #endif
     1.5  
     1.6  HandleType_t g_PlIter;
     1.7 +ConVar sm_datetime_format("sm_datetime_format", "%m/%d/%Y - %H:%M:%S", 0, "Default formatting time rules");
     1.8  
     1.9  class CoreNativeHelpers : 
    1.10  	public SMGlobalClass,
    1.11 @@ -118,7 +119,12 @@
    1.12  {
    1.13  	char *format, *buffer;
    1.14  	pContext->LocalToString(params[1], &buffer);
    1.15 -	pContext->LocalToString(params[3], &format);
    1.16 +	pContext->LocalToStringNULL(params[3], &format);
    1.17 +
    1.18 +	if (format == NULL)
    1.19 +	{
    1.20 +		format = const_cast<char *>(sm_datetime_format.GetString());
    1.21 +	}
    1.22  
    1.23  #if defined SUBPLATFORM_SECURECRT
    1.24  	_invalid_parameter_handler handler = _set_invalid_parameter_handler(_ignore_invalid_parameter);