File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ std::string percentEncode(std::string str, std::string reserved) {
157157}
158158
159159std::string getTime (std::string format, const time_t * timer) {
160- struct tm * timeinfo;
160+ struct tm timeinfo;
161161 size_t size = 64 ;
162162
163163 time_t rawtime;
@@ -168,8 +168,8 @@ std::string getTime(std::string format, const time_t* timer) {
168168 if (endsWith (format, " GMT" ) == false ) format += " GMT" ;
169169 while (true ) {
170170 std::string buffer (size, ' \0 ' );
171- timeinfo = std::gmtime (timer);
172- size_t ret = std::strftime (&buffer[0 ], size, format.c_str (), timeinfo);
171+ std::gmtime_r (timer, &timeinfo );
172+ size_t ret = std::strftime (&buffer[0 ], size, format.c_str (), & timeinfo);
173173 if (ret != 0 ) {
174174 buffer.resize (ret);
175175 return buffer;
You can’t perform that action at this time.
0 commit comments