From 7894384d70f328934fde91c97a400e55118503f0 Mon Sep 17 00:00:00 2001 From: Sean Middleditch Date: Thu, 19 Mar 2009 15:22:06 -0400 Subject: [PATCH] fix last commit --- libtelnet.c | 9 ++++++++- libtelnet.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libtelnet.c b/libtelnet.c index aee0bc5..6e89f01 100644 --- a/libtelnet.c +++ b/libtelnet.c @@ -829,7 +829,14 @@ void telnet_send_data(telnet_t *telnet, const char *buffer, _send(telnet, buffer + l, i - l); } -/* send sub-request */ +/* send subnegotiation header */ +void telnet_begin_subnegotiation(telnet_t *telnet, unsigned char telopt) { + const char sb[3] = { TELNET_IAC, TELNET_SB, telopt }; + _send(telnet, sb, 3); +} + + +/* send complete subnegotiation */ void telnet_send_subnegotiation(telnet_t *telnet, unsigned char telopt, const char *buffer, size_t size) { const char sb[3] = { TELNET_IAC, TELNET_SB, telopt }; diff --git a/libtelnet.h b/libtelnet.h index 37b1350..039cba5 100644 --- a/libtelnet.h +++ b/libtelnet.h @@ -209,7 +209,7 @@ extern void telnet_begin_subnegotiation(telnet_t *telnet, /* send IAC SE */ #define telnet_finish_subnegotiation(telnet) \ - telnet_command((telnet), TELNET_SE) + telnet_send_command((telnet), TELNET_SE) /* shortcut for sending a complete subnegotiation buffer. * equivalent to: