diff --git a/win_res.rc b/win_res.rc index 6b8a3893..156019d4 100644 --- a/win_res.rc +++ b/win_res.rc @@ -52,14 +52,14 @@ BEGIN END /* Accelerators used: co */ -IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 260, 119 +IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 300, 119 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "PuTTY Event Log" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "&Close", IDOK, 135, 102, 44, 14 PUSHBUTTON "C&opy", IDN_COPY, 81, 102, 44, 14 - LISTBOX IDN_LIST, 3, 3, 254, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | LBS_EXTENDEDSEL + LISTBOX IDN_LIST, 3, 3, 294, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | LBS_EXTENDEDSEL END /* No accelerators used */ diff --git a/windlg.c b/windlg.c index f164f3e0..7f994680 100644 --- a/windlg.c +++ b/windlg.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "ssh.h" #include "putty.h" @@ -2038,12 +2039,20 @@ int do_reconfig (HWND hwnd) { } void logevent (char *string) { + char timebuf[40]; + time_t t; + if (nevents >= negsize) { negsize += 64; events = srealloc (events, negsize * sizeof(*events)); } - events[nevents] = smalloc(1+strlen(string)); - strcpy (events[nevents], string); + + 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;