Changes in / [85bb19b:a7fac14]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r11e78d5 r6500907 1223 1223 void G_GNUC_PRINTF(1, 2) owl_function_debugmsg(const char *fmt, ...) 1224 1224 { 1225 char *tmpbuff;1226 1225 FILE *file; 1227 1226 time_t now; … … 1238 1237 now = time(NULL); 1239 1238 1240 tmpbuff = owl_util_time_to_timestr(localtime(&now)); 1241 fprintf(file, "[%d - %s - %lds]: ", 1242 (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g)); 1243 g_free(tmpbuff); 1239 fprintf(file, "[%d - %.24s - %lds]: ", 1240 (int) getpid(), ctime(&now), now - owl_global_get_starttime(&g)); 1244 1241 vfprintf(file, fmt, ap); 1245 1242 putc('\n', file); … … 1764 1761 void owl_function_status(void) 1765 1762 { 1766 char *tmpbuff;1767 1763 char buff[MAXPATHLEN+1]; 1768 1764 time_t start; … … 1792 1788 owl_fmtext_append_normal(&fm, "\n"); 1793 1789 1794 tmpbuff = owl_util_time_to_timestr(localtime(&start)); 1795 owl_fmtext_appendf_normal(&fm, " Startup Time: %s\n", tmpbuff); 1796 g_free(tmpbuff); 1790 owl_fmtext_appendf_normal(&fm, " Startup Time: %s", ctime(&start)); 1797 1791 1798 1792 up=owl_global_get_runtime(&g); … … 3415 3409 char *buff; 3416 3410 3417 now = time(NULL); 3418 date = owl_util_time_to_timestr(localtime(&now)); 3411 now=time(NULL); 3412 date=g_strdup(ctime(&now)); 3413 date[strlen(date)-1]='\0'; 3419 3414 3420 3415 buff = g_strdup_printf("%s %s", date, string); -
message.c
r11e78d5 r6500907 46 46 47 47 /* save the time */ 48 m->time = time(NULL); 49 m->timestr = owl_util_time_to_timestr(localtime(&m->time)); 48 m->time=time(NULL); 49 m->timestr=g_strdup(ctime(&(m->time))); 50 m->timestr[strlen(m->timestr)-1]='\0'; 50 51 51 52 m->fmtext = NULL; … … 795 796 /* save the time, we need to nuke the string saved by message_init */ 796 797 if (m->timestr) g_free(m->timestr); 797 m->time = n->z_time.tv_sec; 798 m->timestr = owl_util_time_to_timestr(localtime(&m->time)); 798 m->time=n->z_time.tv_sec; 799 m->timestr=g_strdup(ctime(&(m->time))); 800 m->timestr[strlen(m->timestr)-1]='\0'; 799 801 800 802 /* set other info */ -
perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm
r11e78d5 r7aa1fa5 29 29 use BarnOwl; 30 30 use BarnOwl::Message::Twitter; 31 use POSIX qw( strftime);31 use POSIX qw(asctime); 32 32 33 33 use LWP::UserAgent; … … 247 247 ($self->{cfg}->{account_nickname} ? 248 248 "[$self->{cfg}->{account_nickname}]" : "") . 249 ": ratelimited until " . strftime('%c',localtime($timeout)));249 ": ratelimited until " . asctime(localtime($timeout))); 250 250 } elsif(exists($ratelimit->{error})) { 251 251 $self->sleep(60*20); -
util.c
r11e78d5 r8219374 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 being301 * 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 311 298 /* These are in order of their value in owl.h */ 312 299 static const struct {
Note: See TracChangeset
for help on using the changeset viewer.