summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Timer.cpp
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2009-03-21 23:00:25 +0000
committernakeee <nakeee@gmail.com>2009-03-21 23:00:25 +0000
commitd88a10d55ca9e795853a2e474387669e727c63a9 (patch)
treee0838e065e65c1d36312d2a1b73ed9c27156a86c /Source/Core/Common/Src/Timer.cpp
parent7572e0bf8d455a4e198bb4c2ecc2880f9d9e8a2f (diff)
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
Diffstat (limited to 'Source/Core/Common/Src/Timer.cpp')
-rw-r--r--Source/Core/Common/Src/Timer.cpp7
1 files 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);
}