From dcc8997d116f615195aa7c9ec019fb36c28c6228 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 24 Feb 2015 12:30:59 +1100 Subject: Convert two macros into functions. Convert packet_send_debug and packet_disconnect from macros to functions. Some older GCCs (2.7.x, 2.95.x) see to have problems with variadic macros with only one argument so we convert these two into functions. ok djm@ --- opacket.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'opacket.c') diff --git a/opacket.c b/opacket.c index dd443c331..5eae633b6 100644 --- a/opacket.c +++ b/opacket.c @@ -319,3 +319,27 @@ packet_read_expect(int expected_type) if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0) sshpkt_fatal(active_state, __func__, r); } + +void +packet_disconnect(const char *fmt, ...) +{ + char buf[1024]; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + ssh_packet_disconnect(active_state, "%s", buf); +} + +void +packet_send_debug(const char *fmt, ...) +{ + char buf[1024]; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + ssh_packet_send_debug(active_state, "%s", buf); +} -- cgit v1.2.3