Replaced some thread un-safe functions with their safe counterparts
This commit is contained in:
@@ -262,11 +262,13 @@ FILE * server_generate_directory_index(config_host *hconfig, const char* dirpath
|
||||
}
|
||||
|
||||
time_t file_mtime = (time_t)filestat->st_mtim.tv_sec;
|
||||
char* file_mod_time = ctime(&file_mtime);
|
||||
char* file_mod_time = calloc(32, sizeof(char));
|
||||
ctime_r(&file_mtime, file_mod_time);
|
||||
|
||||
utstring_printf(index, "<tr><td>%s</td><td>%s</td><td>%s</td></tr>\r\n", uri,
|
||||
(filesize!=NULL)?filesize:"N/A",
|
||||
(file_mod_time!=NULL)?file_mod_time:"N/A");
|
||||
free(file_mod_time);
|
||||
free(filepath);
|
||||
free(filesize);
|
||||
free(uri);
|
||||
|
||||
Reference in New Issue
Block a user