diff options
Diffstat (limited to '')
-rw-r--r-- | src/espik_net.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/espik_net.c b/src/espik_net.c index 2731165..4ecb7ce 100644 --- a/src/espik_net.c +++ b/src/espik_net.c @@ -11,6 +11,7 @@ #include "espik_common_handler.h" #include "espik_error.h" #include "espik_debug.h" +#include "espik_irc.h" #include "espik.h" typedef int (*Handler_Func) (void* data, int ev_type, void* ev); @@ -113,27 +114,23 @@ void espik_con_shutdown () void espik_raw_send (char *msg) { - int len; - char* out; + buf_t buf; espik_enter(); - len = strlen (msg) + 3; + buf = make_buffer (strlen(msg) + 3); - out = malloc (sizeof (char) * len); + snprintf (buf.buf, buf.len, "%s\r\n", msg); - snprintf (out, len, "%s\r\n", msg); - - espik_debug_print ("msg: %s\nout: %s", msg, out); + espik_debug_print ("msg: %s\nout: %s", msg, buf.buf); /* printf ("out[len-3]: 0x%X\n", out[len - 3]); printf ("out[len-2]: 0x%X\n", out[len - 2]); printf ("out[len-1]: 0x%X\n", out[len - 1]); */ - ret = ecore_con_server_send (con_sock, out, strlen (out)); + ret = ecore_con_server_send (con_sock, buf.buf, buf.len); /* espik_debug_print ("%d", ret); */ - - free (out); + free (buf.buf); espik_leave(); } |