aboutsummaryrefslogtreecommitdiffstats
path: root/util/telnet-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/telnet-client.c')
-rw-r--r--util/telnet-client.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/util/telnet-client.c b/util/telnet-client.c
index 6e17726..d2addf2 100644
--- a/util/telnet-client.c
+++ b/util/telnet-client.c
@@ -89,11 +89,19 @@ static void _send(int sock, const char *buffer, size_t size) {
static void _event_handler(telnet_t *telnet, telnet_event_t *ev,
void *user_data) {
int sock = *(int*)user_data;
+ int i;
switch (ev->type) {
/* data received */
case TELNET_EV_DATA:
- printf("%.*s", (int)ev->size, ev->buffer);
+ for (i = 0; i < ev->size; ++i) {
+ if (ev->buffer[i] == '\n') {
+ putchar('\r');
+ putchar('\n');
+ } else
+ putchar(ev->buffer[i]);
+ }
+
fflush(stdout);
break;
/* data must be sent */