src/socket.c

changeset 3867
0e747b4295cb
parent 3499
a990e5706445
child 8046
c581b20a47d6
--- a/src/socket.c	Sun Nov 03 07:32:07 2002 +0000
+++ b/src/socket.c	Sun Nov 03 07:36:09 2002 +0000
@@ -31,6 +31,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <unistd.h>
 #include "gaim.h"
 #include "gaim-socket.h"
 
@@ -102,19 +103,19 @@
 	struct gaim_cui_packet *p = g_new0(struct gaim_cui_packet, 1);
 	char *data = NULL;
 
-	if (!(read(fd, p->type, sizeof(p->type)))) {
+	if (!(read(fd, &p->type, sizeof(p->type)))) {
 		g_free(p);
 		return NULL;
 	}
 	
 	
-	if (!(read(fd, p->subtype, sizeof(p->subtype)))) {
+	if (!(read(fd, &p->subtype, sizeof(p->subtype)))) {
 		g_free(p);
 		return NULL;
 	}
 	
 	
-	if (!(read(fd, p->length, sizeof(p->length)))) {
+	if (!(read(fd, &p->length, sizeof(p->length)))) {
 		g_free(p);
 		return NULL;
 	}
@@ -127,6 +128,7 @@
 		}
 	}
 	p->data = data;
+	return p;
 }
 
 /* copied directly from xmms_connect_to_session */

mercurial