1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Simplify ssh_pkt_addstring_str().

It's just ssh_pkt_addstring_data but using strlen to get the length of
string to add, so make that explicit by having it call
ssh_pkt_addstring_data.  Good compilers should be unaffected by this
change.
This commit is contained in:
Ben Harris 2015-05-10 21:12:37 +01:00
parent 511d967d25
commit 830a454a42

9
ssh.c
View File

@ -2127,17 +2127,16 @@ static void ssh_pkt_addstring_start(struct Packet *pkt)
ssh_pkt_adduint32(pkt, 0);
pkt->savedpos = pkt->length;
}
static void ssh_pkt_addstring_str(struct Packet *pkt, const char *data)
{
ssh_pkt_adddata(pkt, data, strlen(data));
PUT_32BIT(pkt->data + pkt->savedpos - 4, pkt->length - pkt->savedpos);
}
static void ssh_pkt_addstring_data(struct Packet *pkt, const char *data,
int len)
{
ssh_pkt_adddata(pkt, data, len);
PUT_32BIT(pkt->data + pkt->savedpos - 4, pkt->length - pkt->savedpos);
}
static void ssh_pkt_addstring_str(struct Packet *pkt, const char *data)
{
ssh_pkt_addstring_data(pkt, data, strlen(data));
}
static void ssh_pkt_addstring(struct Packet *pkt, const char *data)
{
ssh_pkt_addstring_start(pkt);