Changes in / [85bb19b:a7fac14]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r11e78d5 r6500907  
    12231223void G_GNUC_PRINTF(1, 2) owl_function_debugmsg(const char *fmt, ...)
    12241224{
    1225   char *tmpbuff;
    12261225  FILE *file;
    12271226  time_t now;
     
    12381237  now = time(NULL);
    12391238
    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));
    12441241  vfprintf(file, fmt, ap);
    12451242  putc('\n', file);
     
    17641761void owl_function_status(void)
    17651762{
    1766   char *tmpbuff;
    17671763  char buff[MAXPATHLEN+1];
    17681764  time_t start;
     
    17921788  owl_fmtext_append_normal(&fm, "\n");
    17931789
    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));
    17971791
    17981792  up=owl_global_get_runtime(&g);
     
    34153409  char *buff;
    34163410
    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';
    34193414
    34203415  buff = g_strdup_printf("%s %s", date, string);
  • message.c

    r11e78d5 r6500907  
    4646 
    4747  /* 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';
    5051
    5152  m->fmtext = NULL;
     
    795796  /* save the time, we need to nuke the string saved by message_init */
    796797  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';
    799801
    800802  /* set other info */
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm

    r11e78d5 r7aa1fa5  
    2929use BarnOwl;
    3030use BarnOwl::Message::Twitter;
    31 use POSIX qw(strftime);
     31use POSIX qw(asctime);
    3232
    3333use LWP::UserAgent;
     
    247247                       ($self->{cfg}->{account_nickname} ?
    248248                        "[$self->{cfg}->{account_nickname}]" : "") .
    249                         ": ratelimited until " . strftime('%c', localtime($timeout)));
     249                        ": ratelimited until " . asctime(localtime($timeout)));
    250250    } elsif(exists($ratelimit->{error})) {
    251251        $self->sleep(60*20);
  • util.c

    r11e78d5 r8219374  
    296296}
    297297
    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 
    311298/* These are in order of their value in owl.h */
    312299static const struct {
Note: See TracChangeset for help on using the changeset viewer.