]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/ipc.c
Replace strncpy call with memcpy when result is not NUL-terminated
[i3/i3] / i3bar / src / ipc.c
index 7a657338472e7fd6941e38a82b3e7eaf78e1654f..56fe279899c442572c7f8ba99d2f60b154a302b9 100644 (file)
@@ -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);