From 4e142107885890558cea13225f76a320e1647184 Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 10 Aug 2011 02:39:13 +0200 Subject: [PATCH] added some debug output --- ClientSocket.c | 3 +++ ClientSocket.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ClientSocket.c b/ClientSocket.c index 37a5ebd..c071e1c 100644 --- a/ClientSocket.c +++ b/ClientSocket.c @@ -147,10 +147,13 @@ void socket_loop(int timeout_seconds) { sock->buffer[sock->bufferpos + i] = buffer[i]; } sock->bufferpos += i; + sock->buffer[sock->bufferpos] = 0; //debug only + printf("BUFFER: %s\n", sock->buffer); } } else { bytes = read(sock->sock, sock->buffer, sizeof(sock->buffer)); sock->buffer[bytes] = 0; //debug only + printf("BUFFER: %s\n", sock->buffer); if(bytes > 0) sock->bufferpos = bytes; } diff --git a/ClientSocket.h b/ClientSocket.h index 55f4625..39118ec 100644 --- a/ClientSocket.h +++ b/ClientSocket.h @@ -29,6 +29,6 @@ int connect_socket(struct ClientSocket *client); int close_socket(struct ClientSocket *client); int write_socket(struct ClientSocket *client, char* msg, int len); void socket_loop(int timeout_seconds); -void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(1, 2); +void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3); #endif \ No newline at end of file -- 2.20.1