| 162 | } |
| 163 | |
| 164 | int set_datestr(char *datestr, size_t n, const time_t timev) |
| 165 | { |
| 166 | const struct tm *tm_p; |
| 167 | #if ! defined(__MINGW32__) |
| 168 | struct tm tmp; |
| 169 | #endif |
| 170 | if(timev==0) |
| 171 | { |
| 172 | strncpy(datestr, " ", n); |
| 173 | return 0; |
| 174 | } |
| 175 | #if defined(__MINGW32__) || defined(DISABLED_FOR_FRAMAC) |
| 176 | tm_p=localtime(&timev); |
| 177 | #else |
| 178 | tm_p=localtime_r(&timev, &tmp); |
| 179 | #endif |
| 180 | if(tm_p==NULL) |
| 181 | { |
| 182 | strncpy(datestr, " ", n); |
| 183 | return 0; |
| 184 | } |
| 185 | snprintf(datestr, n,"%2d-%s-%4d %02d:%02d", |
| 186 | tm_p->tm_mday, monstr[tm_p->tm_mon], |
| 187 | 1900 + tm_p->tm_year, tm_p->tm_hour, |
| 188 | tm_p->tm_min); |
| 189 | if(1900+tm_p->tm_year>=2000) |
| 190 | return 1; |
| 191 | return 0; |
| 192 | } |
| 193 | |
| 194 | int dir_aff_log(const dir_data_t *dir_data, const file_info_t *dir_list) |
| 195 | { |
no test coverage detected