From d88a10d55ca9e795853a2e474387669e727c63a9 Mon Sep 17 00:00:00 2001 From: nakeee Date: Sat, 21 Mar 2009 23:00:25 +0000 Subject: [PATCH] fix time printing in linux No idea why it should be needed though... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2721 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Timer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp index 708798aabf..ad0016b3f2 100644 --- a/Source/Core/Common/Src/Timer.cpp +++ b/Source/Core/Common/Src/Timer.cpp @@ -196,15 +196,18 @@ std::string Timer::GetTimeFormatted() time_t sysTime; struct tm * gmTime; char formattedTime[13]; + char tmp[13]; time(&sysTime); gmTime = localtime(&sysTime); - strftime(formattedTime, 6, "%M:%S", gmTime); + + strftime(tmp, 6, "%M:%S", gmTime); + // Now tack on the milliseconds struct timeb tp; (void)::ftime(&tp); - sprintf(formattedTime, "%s:%03i", formattedTime, tp.millitm); + sprintf(formattedTime, "%s:%03i", tmp, tp.millitm); return std::string(formattedTime); }