diff options
| author | bunnei <bunneidev@gmail.com> | 2014-10-25 15:19:05 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2014-10-25 15:19:05 -0400 |
| commit | 70058f8151a9c6599bbcd9d5772b87c9602ed0fa (patch) | |
| tree | b7f0711f1d817b18f041fea31cfcf0ebe9cbba69 /src/common/timer.cpp | |
| parent | 4615c73d15f6f27c5e275c57dcafcb56355b9c2d (diff) | |
| parent | 7fa4dbd0c6e89aab762eaf29607a0a0ced660847 (diff) | |
Merge pull request #148 from archshift/no-cstring
Removed some uses of raw c-string manipulation functions.
Diffstat (limited to 'src/common/timer.cpp')
| -rw-r--r-- | src/common/timer.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/common/timer.cpp b/src/common/timer.cpp index f8e1fadca..ded4a344e 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -169,7 +169,6 @@ std::string Timer::GetTimeFormatted() { time_t sysTime; struct tm * gmTime; - char formattedTime[13]; char tmp[13]; time(&sysTime); @@ -181,14 +180,12 @@ std::string Timer::GetTimeFormatted() #ifdef _WIN32 struct timeb tp; (void)::ftime(&tp); - sprintf(formattedTime, "%s:%03i", tmp, tp.millitm); + return StringFromFormat("%s:%03i", tmp, tp.millitm); #else struct timeval t; (void)gettimeofday(&t, NULL); - sprintf(formattedTime, "%s:%03d", tmp, (int)(t.tv_usec / 1000)); + return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); #endif - - return std::string(formattedTime); } // Returns a timestamp with decimals for precise time comparisons |
