portfwd validation was sometimes not picking up a blank source port
[u/mdw/putty] / config.c
index 2fc2362..8250e1c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -718,7 +718,7 @@ static void portfwd_handler(union control *ctrl, void *dlg,
            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;
            }