diff options
| author | 2014-10-23 21:17:01 -0700 | |
|---|---|---|
| committer | 2014-10-23 21:44:10 -0700 | |
| commit | 7fa4dbd0c6e89aab762eaf29607a0a0ced660847 (patch) | |
| tree | 693ec14d1c71c311e5d5d08b6d9f96711f7bced1 /src/common/timer.cpp | |
| parent | Merge pull request #133 from archshift/sdmc-enabled (diff) | |
| download | yuzu-7fa4dbd0c6e89aab762eaf29607a0a0ced660847.tar.gz yuzu-7fa4dbd0c6e89aab762eaf29607a0a0ced660847.tar.xz yuzu-7fa4dbd0c6e89aab762eaf29607a0a0ced660847.zip | |
Removed 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() | |||
| 169 | { | 169 | { |
| 170 | time_t sysTime; | 170 | time_t sysTime; |
| 171 | struct tm * gmTime; | 171 | struct tm * gmTime; |
| 172 | char formattedTime[13]; | ||
| 173 | char tmp[13]; | 172 | char tmp[13]; |
| 174 | 173 | ||
| 175 | time(&sysTime); | 174 | time(&sysTime); |
| @@ -181,14 +180,12 @@ std::string Timer::GetTimeFormatted() | |||
| 181 | #ifdef _WIN32 | 180 | #ifdef _WIN32 |
| 182 | struct timeb tp; | 181 | struct timeb tp; |
| 183 | (void)::ftime(&tp); | 182 | (void)::ftime(&tp); |
| 184 | sprintf(formattedTime, "%s:%03i", tmp, tp.millitm); | 183 | return StringFromFormat("%s:%03i", tmp, tp.millitm); |
| 185 | #else | 184 | #else |
| 186 | struct timeval t; | 185 | struct timeval t; |
| 187 | (void)gettimeofday(&t, NULL); | 186 | (void)gettimeofday(&t, NULL); |
| 188 | sprintf(formattedTime, "%s:%03d", tmp, (int)(t.tv_usec / 1000)); | 187 | return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); |
| 189 | #endif | 188 | #endif |
| 190 | |||
| 191 | return std::string(formattedTime); | ||
| 192 | } | 189 | } |
| 193 | 190 | ||
| 194 | // Returns a timestamp with decimals for precise time comparisons | 191 | // Returns a timestamp with decimals for precise time comparisons |