time_t t;
struct tm tm;
void logevent_dlg(void *estuff, const char *string){    struct eventlog_stuff *es = (struct eventlog_stuff *)estuff;    char timebuf[40];    time_t t;    if (es->nevents >= es->negsize) {	es->negsize += 64;	es->events = sresize(es->events, es->negsize, char *);    }    time(&t);    strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S\t",	     localtime(&t));    es->events[es->nevents] = snewn(strlen(timebuf) + strlen(string) + 1, char);    strcpy(es->events[es->nevents], timebuf);    strcat(es->events[es->nevents], string);    if (es->window) {	dlg_listbox_add(es->listctrl, &es->dp, es->events[es->nevents]);    }    es->nevents++;}