mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +00:00
Avoid mallocing zero bytes in the event log Copy processing, which
was apparently a problem for compilers other than Visual C. Thanks to Roman Pompejus for pointing it out. [originally from svn r918]
This commit is contained in:
parent
48699e8431
commit
4707d0823e
5
windlg.c
5
windlg.c
@ -66,6 +66,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
|
||||
int *selitems;
|
||||
selcount = SendDlgItemMessage(hwnd, IDN_LIST,
|
||||
LB_GETSELCOUNT, 0, 0);
|
||||
if (selcount == 0) { /* don't even try to copy zero items */
|
||||
MessageBeep(0);
|
||||
break;
|
||||
}
|
||||
|
||||
selitems = smalloc(selcount * sizeof(int));
|
||||
if (selitems) {
|
||||
int count = SendDlgItemMessage(hwnd, IDN_LIST,
|
||||
|
Loading…
Reference in New Issue
Block a user