mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Fix an assortment of dupprintf() format string bugs.
I've enabled gcc's format-string checking on dupprintf, by declaring it in misc.h to have the appropriate GNU-specific attribute. This pointed out a selection of warnings, which I've fixed. [originally from svn r10084]
This commit is contained in:
4
ssh.c
4
ssh.c
@ -3292,7 +3292,7 @@ static void ssh_socket_log(Plug plug, int type, SockAddr addr, int port,
|
||||
if (sk_addr_needs_port(addr)) {
|
||||
msg = dupprintf("Connecting to %s port %d", addrbuf, port);
|
||||
} else {
|
||||
msg = dupprintf("Connecting to %s", addrbuf, port);
|
||||
msg = dupprintf("Connecting to %s", addrbuf);
|
||||
}
|
||||
} else {
|
||||
msg = dupprintf("Failed to connect to %s: %s", addrbuf, error_msg);
|
||||
@ -5292,7 +5292,7 @@ static void ssh1_msg_port_open(Ssh ssh, struct Packet *pktin)
|
||||
ssh_pkt_getstring(pktin, &host, &hostsize);
|
||||
port = ssh_pkt_getuint32(pktin);
|
||||
|
||||
pf.dhost = dupprintf(".*s", hostsize, host);
|
||||
pf.dhost = dupprintf("%.*s", hostsize, host);
|
||||
pf.dport = port;
|
||||
pfp = find234(ssh->rportfwds, &pf, NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user