diff mcabber/src/server.c @ 27:77e6bd2ccde6

[/trunk] Changeset 43 by mikael * Some more very small fixes, nothing serious.
author mikael
date Mon, 28 Mar 2005 09:18:01 +0000
parents 8588f5a4b638
children 0cd8025eebee
line wrap: on
line diff
--- a/mcabber/src/server.c	Mon Mar 28 08:54:43 2005 +0000
+++ b/mcabber/src/server.c	Mon Mar 28 09:18:01 2005 +0000
@@ -50,10 +50,10 @@
  */
 static u_long srv_resolve(const char *host)
 {
-  long i;
+  in_addr_t i;
   struct hostent *he;
 
-  if ((i = inet_addr(host)) == -1) {
+  if ((i = inet_addr(host)) == INADDR_NONE) {
     if (!(he = gethostbyname(host)))
       return 0;
     else
@@ -157,7 +157,7 @@
     free(stringtosend);
     return NULL;
   }
-  strncpy(idsession, aux, pos);
+  strncpy(idsession, aux, (size_t)pos);
 
   free(response);
 
@@ -274,7 +274,7 @@
   char *utf8inputline = utf8_encode(text);
 
   sprintf(stringtosend,
-	  "<message from='%s' to='%s' type='chat'><body>%s</body></message>",
+	  "<message from='%s' to='%s' type='chat'><body>%.1536s</body></message>",
 	  from, to, utf8inputline);
   if (!sk_send(sock, stringtosend)) {
     perror("senddata (server.c:247)");