summaryrefslogtreecommitdiff
path: root/opacket.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2015-02-24 12:30:59 +1100
committerDarren Tucker <dtucker@zip.com.au>2015-02-24 12:30:59 +1100
commitdcc8997d116f615195aa7c9ec019fb36c28c6228 (patch)
treefe2b276636ec05203f48608e2ff734e4c76dbf68 /opacket.c
parent2285c30d51b7e2052c6526445abe7e7cc7e170a1 (diff)
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@
Diffstat (limited to 'opacket.c')
-rw-r--r--opacket.c24
1 files changed, 24 insertions, 0 deletions
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)
319 if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0) 319 if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0)
320 sshpkt_fatal(active_state, __func__, r); 320 sshpkt_fatal(active_state, __func__, r);
321} 321}
322
323void
324packet_disconnect(const char *fmt, ...)
325{
326 char buf[1024];
327 va_list args;
328
329 va_start(args, fmt);
330 vsnprintf(buf, sizeof(buf), fmt, args);
331 va_end(args);
332 ssh_packet_disconnect(active_state, "%s", buf);
333}
334
335void
336packet_send_debug(const char *fmt, ...)
337{
338 char buf[1024];
339 va_list args;
340
341 va_start(args, fmt);
342 vsnprintf(buf, sizeof(buf), fmt, args);
343 va_end(args);
344 ssh_packet_send_debug(active_state, "%s", buf);
345}