Fixed buffer length

This commit is contained in:
buffet 2018-10-29 23:56:12 +01:00
parent 11f5fb173d
commit fa503bf630

View file

@ -112,7 +112,7 @@ main(int argc, char *argv[])
client_fd = accept(g_sock_fd, NULL, 0);
if (!(client_fd < 0) && (msg_len = read(client_fd, msg, sizeof(msg))) > 0) {
if (!(client_fd < 0) && (msg_len = read(client_fd, msg, sizeof(msg) - 1)) > 0) {
// client sent something
msg[msg_len] = '\0';
handle_ipc_event(msg);