* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
*
*/
+#include "libi3.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <i3/ipc.h>
-#include "libi3.h"
-
/*
* Reads a message from the given socket file descriptor and stores its length
* (reply_length) as well as a pointer to its contents (reply).
if (n == -1)
return -1;
if (n == 0) {
- ELOG("IPC: received EOF instead of reply\n");
return -2;
}
}
walk += strlen(I3_IPC_MAGIC);
- *reply_length = *((uint32_t*)walk);
+ memcpy(reply_length, walk, sizeof(uint32_t));
walk += sizeof(uint32_t);
if (message_type != NULL)
- *message_type = *((uint32_t*)walk);
+ memcpy(message_type, walk, sizeof(uint32_t));
*reply = smalloc(*reply_length);