/* If at this point we have a valid session, go! */
if (*cfg2.host) {
*cfg = cfg2; /* structure copy */
- cfg->remote_cmd_ptr = cfg->remote_cmd; /* nasty */
+ cfg->remote_cmd_ptr = NULL;
dlg_end(dlg, 1);
} else
dlg_beep(dlg);
struct portfwd_data {
union control *addbutton, *rembutton, *listbox;
union control *sourcebox, *destbox, *direction;
+#ifndef NO_IPV6
union control *addressfamily;
+#endif
};
static void portfwd_handler(union control *ctrl, void *dlg,
* Default is Local.
*/
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);
+#endif
}
} else if (event == EVENT_ACTION) {
if (ctrl == pfd->addbutton) {
int whichbutton;
i = 0;
+#ifndef NO_IPV6
whichbutton = dlg_radiobutton_get(pfd->addressfamily, dlg);
if (whichbutton == 1)
str[i++] = '4';
else if (whichbutton == 2)
str[i++] = '6';
+#endif
whichbutton = dlg_radiobutton_get(pfd->direction, dlg);
if (whichbutton == 0)
str[i++] = type;
dlg_editbox_get(pfd->sourcebox, dlg, str+i, sizeof(str) - i);
- if (!str[2]) {
+ if (!str[i]) {
dlg_error_msg(dlg, "You need to specify a source port number");
return;
}
if (type != 'D') {
*p++ = '\t';
dlg_editbox_get(pfd->destbox, dlg, p,
- sizeof(str)-1 - (p - str));
+ sizeof(str) - (p - str));
if (!*p || !strchr(p, ':')) {
dlg_error_msg(dlg,
"You need to specify a destination address\n"
p++;
p++;
}
- if ((p - cfg->portfwd) + strlen(str) + 2 <
+ if ((p - cfg->portfwd) + strlen(str) + 2 <=
sizeof(cfg->portfwd)) {
strcpy(p, str);
p[strlen(str) + 1] = '\0';