From 830a454a42ef817c39ff3ed863b01795927a8132 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 10 May 2015 21:12:37 +0100 Subject: [PATCH] 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. --- ssh.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ssh.c b/ssh.c index 14bff6fe..9feed64d 100644 --- a/ssh.c +++ b/ssh.c @@ -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);