strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S    ", localtime(&t));
strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S\t", localtime(&t));
void logevent (char *string) {    char timebuf[40];    time_t t;    if (nevents >= negsize) {	negsize += 64;	events = srealloc (events, negsize * sizeof(*events));    }    time(&t);    strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S    ", localtime(&t));    events[nevents] = smalloc(strlen(timebuf)+strlen(string)+1);    strcpy(events[nevents], timebuf);    strcat(events[nevents], string);    nevents++;    if (logbox) {        int count;	SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING,			    0, (LPARAM)string);	count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0);	SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0);    }}