X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=cmdline.c;h=bafb939914af4ca0ea24165e40d104fcadff2bd1;hb=60d2ee13521c24a740185370130eb2bb0ea74f38;hp=2c3b7ce5caf0715ea62c4ba213999d90b2d0e11b;hpb=c2b2346f0be464fdd1925dfe3023b40bc5ce53bd;p=PuTTY_svn.git diff --git a/cmdline.c b/cmdline.c index 2c3b7ce5..bafb9399 100644 --- a/cmdline.c +++ b/cmdline.c @@ -63,7 +63,7 @@ void cmdline_cleanup(void) int pri; if (cmdline_password) { - memset(cmdline_password, 0, strlen(cmdline_password)); + smemclr(cmdline_password, strlen(cmdline_password)); sfree(cmdline_password); cmdline_password = NULL; } @@ -106,7 +106,7 @@ int cmdline_get_passwd_input(prompts_t *p, unsigned char *in, int inlen) { return 0; prompt_set_result(p->prompts[0], cmdline_password); - memset(cmdline_password, 0, strlen(cmdline_password)); + smemclr(cmdline_password, strlen(cmdline_password)); sfree(cmdline_password); cmdline_password = NULL; tried_once = 1; @@ -275,7 +275,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) return ret; } - key = dupprintf("%c%.*s", type, q - value, value); + key = dupprintf("%c%.*s", type, (int)(q - value), value); val = dupstr(q+1); } else { /* @@ -307,7 +307,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) return ret; } - host = dupprintf("%.*s", portp - value, value); + host = dupprintf("%.*s", (int)(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); @@ -368,7 +368,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) /* Assuming that `value' is directly from argv, make a good faith * attempt to trample it, to stop it showing up in `ps' output * on Unix-like systems. Not guaranteed, of course. */ - memset(value, 0, strlen(value)); + smemclr(value, strlen(value)); } }