mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Platform-independent fixes for NO_IPV6 compilation (prevent
segfaults on trying to access pfd->addressfamily which doesn't exist). [originally from svn r5444]
This commit is contained in:
parent
5c5dc61522
commit
7b22e5b2ab
8
config.c
8
config.c
@ -666,7 +666,9 @@ static void environ_handler(union control *ctrl, void *dlg,
|
|||||||
struct portfwd_data {
|
struct portfwd_data {
|
||||||
union control *addbutton, *rembutton, *listbox;
|
union control *addbutton, *rembutton, *listbox;
|
||||||
union control *sourcebox, *destbox, *direction;
|
union control *sourcebox, *destbox, *direction;
|
||||||
|
#ifndef NO_IPV6
|
||||||
union control *addressfamily;
|
union control *addressfamily;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static void portfwd_handler(union control *ctrl, void *dlg,
|
static void portfwd_handler(union control *ctrl, void *dlg,
|
||||||
@ -691,8 +693,10 @@ static void portfwd_handler(union control *ctrl, void *dlg,
|
|||||||
* Default is Local.
|
* Default is Local.
|
||||||
*/
|
*/
|
||||||
dlg_radiobutton_set(ctrl, dlg, 0);
|
dlg_radiobutton_set(ctrl, dlg, 0);
|
||||||
} else if (ctrl == pfd->addressfamily) {
|
#ifndef NO_IPV6
|
||||||
|
} else if (ctrl == pfd->addressfamily) {
|
||||||
dlg_radiobutton_set(ctrl, dlg, 0);
|
dlg_radiobutton_set(ctrl, dlg, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else if (event == EVENT_ACTION) {
|
} else if (event == EVENT_ACTION) {
|
||||||
if (ctrl == pfd->addbutton) {
|
if (ctrl == pfd->addbutton) {
|
||||||
@ -702,11 +706,13 @@ static void portfwd_handler(union control *ctrl, void *dlg,
|
|||||||
int whichbutton;
|
int whichbutton;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
#ifndef NO_IPV6
|
||||||
whichbutton = dlg_radiobutton_get(pfd->addressfamily, dlg);
|
whichbutton = dlg_radiobutton_get(pfd->addressfamily, dlg);
|
||||||
if (whichbutton == 1)
|
if (whichbutton == 1)
|
||||||
str[i++] = '4';
|
str[i++] = '4';
|
||||||
else if (whichbutton == 2)
|
else if (whichbutton == 2)
|
||||||
str[i++] = '6';
|
str[i++] = '6';
|
||||||
|
#endif
|
||||||
|
|
||||||
whichbutton = dlg_radiobutton_get(pfd->direction, dlg);
|
whichbutton = dlg_radiobutton_get(pfd->direction, dlg);
|
||||||
if (whichbutton == 0)
|
if (whichbutton == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user