MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / set_datestr

Function set_datestr

src/dir.c:164–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164int 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
194int dir_aff_log(const dir_data_t *dir_data, const file_info_t *dir_list)
195{

Callers 6

dir_aff_entryFunction · 0.85
dir_aff_ncursesFunction · 0.85
dir_aff_logFunction · 0.85
log_list_fileFunction · 0.85
ask_root_directoryFunction · 0.85

Calls 2

localtime_rFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected