was apparently a problem for compilers other than Visual C. Thanks
to Roman Pompejus for pointing it out.
git-svn-id: svn://svn.tartarus.org/sgt/putty@918
cda61777-01e9-0310-a592-
d414129be87e
int *selitems;
selcount = SendDlgItemMessage(hwnd, IDN_LIST,
LB_GETSELCOUNT, 0, 0);
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,
selitems = smalloc(selcount * sizeof(int));
if (selitems) {
int count = SendDlgItemMessage(hwnd, IDN_LIST,