]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - cmdline.c
Fix an assortment of dupprintf() format string bugs.
[PuTTY.git] / cmdline.c
index a4c91601079e1b461007fe22a03edf08dfcaa3d5..bafb939914af4ca0ea24165e40d104fcadff2bd1 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -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);