From a20637387fe82e3f0c48201428cd0ec206c9cf06 Mon Sep 17 00:00:00 2001 From: "Bertrand Jacquin (Beber)" Date: Thu, 19 Jan 2006 02:50:22 +0100 Subject: free, free free... --- src/espik_common_handler.c | 4 ++-- src/espik_net.c | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/espik_common_handler.c b/src/espik_common_handler.c index 0e6d8c5..118b757 100644 --- a/src/espik_common_handler.c +++ b/src/espik_common_handler.c @@ -119,7 +119,7 @@ int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler) { char* kb; char* tmp; - int count; + int count; espik_enter(); kb = malloc (200); @@ -153,7 +153,7 @@ int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler) espik_debug_print ("tmp: %s", tmp); espik_raw_send (tmp); espik_debug_print ("AFTER espik_raw_send"); - espik_raw_send (tmp); + //espik_raw_send (tmp); /* irc_disconnect(); diff --git a/src/espik_net.c b/src/espik_net.c index d93dda0..5fe8944 100644 --- a/src/espik_net.c +++ b/src/espik_net.c @@ -134,13 +134,14 @@ void espik_raw_send (const char *msg) buf_t buf; espik_enter(); - buf = make_buffer (strlen(msg) + 2); /* \r\n\0" */ + buf = make_buffer (strlen(msg) + 1); /* \r\n\0" */ snprintf (buf.buf, buf.len, "%s\r\n", msg); /* Override trailing \0 */ espik_debug_print("strlen(msg): %d", strlen(msg)); espik_debug_print("buf.len: %d", buf.len); - buf.buf[buf.len] = '\n'; + buf.buf[buf.len-1] = '\n'; +// buf.buf[buf.len] = '\0'; espik_debug_print ("\n\nmsg(%d): %s\n\nout(%d-%d): %s\n", strlen(msg), msg, strlen(buf.buf), buf.len, buf.buf); /* @@ -149,15 +150,15 @@ void espik_raw_send (const char *msg) printf ("out[len-1]: 0x%X\n", out[len - 1]); */ - /* + int i; - for (i = 0 ; i < buf.len; i++) + for (i = 0 ; buf.buf[i] != 0 ; i++) { espik_debug_print ("buf.buf[%d]: '%d'", i, buf.buf[i]); } - */ + - ret = ecore_con_server_send (con_sock, buf.buf, buf.len-1); + ret = ecore_con_server_send (con_sock, buf.buf, buf.len); espik_debug_print ("ret: %d", ret); free (buf.buf); -- cgit v1.2.3