aboutsummaryrefslogtreecommitdiff
path: root/src/espik_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/espik_net.c')
-rw-r--r--src/espik_net.c13
1 files changed, 7 insertions, 6 deletions
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); /* <MESSAGE>\r\n\0" */
+ buf = make_buffer (strlen(msg) + 1); /* <MESSAGE>\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);