- Timestamp:
- Jul 22, 2011, 7:20:26 PM (13 years ago)
- Children:
- 85bb19b
- Parents:
- f661cee
- git-author:
- Jason Gross <jgross@mit.edu> (07/22/11 10:43:43)
- git-committer:
- Jason Gross <jgross@mit.edu> (07/22/11 19:20:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
r8219374 r11e78d5 296 296 } 297 297 298 CALLER_OWN char *owl_util_time_to_timestr(const struct tm *time) 299 { 300 /* 32 chosen for first attempt because timestr will end up being 301 * something like "Www Mmm dd hh:mm:ss AM yyyy UTC\0" */ 302 size_t timestr_size = 16; 303 char *timestr = NULL; 304 do { 305 timestr_size *= 2; 306 timestr = g_realloc(timestr, sizeof(char) * timestr_size); 307 } while (strftime(timestr, timestr_size, "%c", time) == 0); 308 return timestr; 309 } 310 298 311 /* These are in order of their value in owl.h */ 299 312 static const struct {
Note: See TracChangeset
for help on using the changeset viewer.