From 72a66645da5d2296bb5394466df07afe2ff7eb2c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 2 Dec 2003 02:55:14 +0000 Subject: [PATCH] I believe localtime returns NULL on XBox when system clock is not set --- stepmania/src/RageLog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 935c2cd47e..00a93d43c2 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -118,9 +118,13 @@ RageLog::RageLog() time(&cur_time); const struct tm *now = localtime(&cur_time); - this->Trace( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d", - 1900+now->tm_year, now->tm_mon, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec ); - this->Trace( " " ); + if ( now ) + { + this->Trace( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d", + 1900+now->tm_year, now->tm_mon, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec ); + this->Trace( " " ); + } + #if defined(HAVE_VERSION_INFO) this->Info("Compiled %s (build %lu)", version_time, version_num); #endif