X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=cmdline.c;h=2c3b7ce5caf0715ea62c4ba213999d90b2d0e11b;hb=a3f74661c8da1b8ac2eb34b0e73fb70172a85b48;hp=acd3c6626dcaf3998bfa67c3634c9376bb2b3c80;hpb=a1f3b7a358adaa7c2a98359cd0373aa823eeb14b;p=PuTTY.git diff --git a/cmdline.c b/cmdline.c index acd3c662..2c3b7ce5 100644 --- a/cmdline.c +++ b/cmdline.c @@ -105,15 +105,12 @@ int cmdline_get_passwd_input(prompts_t *p, unsigned char *in, int inlen) { if (tried_once) return 0; - strncpy(p->prompts[0]->result, cmdline_password, - p->prompts[0]->result_len); - p->prompts[0]->result[p->prompts[0]->result_len-1] = '\0'; + prompt_set_result(p->prompts[0], cmdline_password); memset(cmdline_password, 0, strlen(cmdline_password)); sfree(cmdline_password); cmdline_password = NULL; tried_once = 1; return 1; - } /* @@ -313,6 +310,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) host = dupprintf("%.*s", portp - value, value); conf_set_str(conf, CONF_ssh_nc_host, host); conf_set_int(conf, CONF_ssh_nc_port, atoi(portp + 1)); + sfree(host); } if (!strcmp(p, "-m")) { char *filename, *command; @@ -456,12 +454,13 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) } if (!strcmp(p, "-i")) { - Filename fn; + Filename *fn; RETURN(2); UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); SAVEABLE(0); fn = filename_from_str(value); - conf_set_filename(conf, CONF_keyfile, &fn); + conf_set_filename(conf, CONF_keyfile, fn); + filename_free(fn); } if (!strcmp(p, "-4") || !strcmp(p, "-ipv4")) { @@ -503,6 +502,10 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) break; case '5': + case '6': + case '7': + case '8': + case '9': conf_set_int(conf, CONF_serdatabits, *nextitem-'0'); break;