Fix bug with uninitialized variable. master
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fri, 30 Jan 2009 23:37:53 +0000 (21:37 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fri, 30 Jan 2009 23:37:53 +0000 (21:37 -0200)
This was making the chat code consider the message be considered as sent
even when it was received, with the possible result of losing messages.

chat.c

diff --git a/chat.c b/chat.c
index 9cfe397..dfa83eb 100644 (file)
--- a/chat.c
+++ b/chat.c
@@ -43,7 +43,7 @@ hc_xmpp_chat (hc_xmpp_t *xmpp, iks *message)
   char *from;
   char *to;
   char *body;
   char *from;
   char *to;
   char *body;
-  int sent;
+  int sent = 0;
   str = iks_string (iks_stack (message), message);
   write (fd, str, strlen (str));
   from = iks_find_attrib (message, "from");
   str = iks_string (iks_stack (message), message);
   write (fd, str, strlen (str));
   from = iks_find_attrib (message, "from");