@@ -1307,9 +1307,9 @@ void respond_request(http_request_t *req) {
13071307 record_stop ();
13081308 }
13091309 }
1310- struct tm * start = localtime (& recordStartTime );
1310+ struct tm tm_buf , * tm_info = localtime_r (& recordStartTime , & tm_buf );
13111311 char start_time [64 ];
1312- strftime (start_time , sizeof (start_time ), "%Y-%m-%dT%H:%M:%SZ" , start );
1312+ strftime (start_time , sizeof (start_time ), "%Y-%m-%dT%H:%M:%SZ" , tm_info );
13131313
13141314 respLen = sprintf (response ,
13151315 "HTTP/1.1 200 OK\r\n"
@@ -1318,7 +1318,7 @@ void respond_request(http_request_t *req) {
13181318 "\r\n"
13191319 "{\"recording\":%s,\"start_time\":\"%s\",\"continuous\":\"%s\",\"path\":\"%s\","
13201320 "\"filename\":\"%s\",\"segment_duration\":%d,\"segment_size\":%d}" ,
1321- recordOn ? "true" : "false" , recordStartTime , app_config .record_continuous ? "true" : "false" ,
1321+ recordOn ? "true" : "false" , start_time , app_config .record_continuous ? "true" : "false" ,
13221322 app_config .record_path , app_config .record_filename ,
13231323 app_config .record_segment_duration , app_config .record_segment_size );
13241324 send_and_close (req -> clntFd , response , respLen );
0 commit comments