X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3bar%2Fsrc%2Fipc.c;h=9a7fb21eb401038c1a63376d36a2874ddc3d4a25;hb=7c0994dafc91944477e03700304b2308b0e3fdb1;hp=7a657338472e7fd6941e38a82b3e7eaf78e1654f;hpb=8a805cdd5cbf6c3564d88ea47a531a1abfd6bcc0;p=i3%2Fi3 diff --git a/i3bar/src/ipc.c b/i3bar/src/ipc.c index 7a657338..9a7fb21e 100644 --- a/i3bar/src/ipc.c +++ b/i3bar/src/ipc.c @@ -278,8 +278,8 @@ void got_data(struct ev_loop *loop, ev_io *watcher, int events) { buffer[size] = '\0'; /* And call the callback (indexed by the type) */ - if (type & (1 << 31)) { - type ^= 1 << 31; + if (type & (1UL << 31)) { + type ^= 1UL << 31; event_handlers[type](buffer); } else { if (reply_handlers[type]) @@ -309,7 +309,7 @@ int i3_send_msg(uint32_t type, const char *payload) { char *buffer = smalloc(to_write); char *walk = buffer; - strncpy(buffer, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC)); + memcpy(buffer, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC)); walk += strlen(I3_IPC_MAGIC); memcpy(walk, &len, sizeof(uint32_t)); walk += sizeof(uint32_t);