Fixed buffer length
This commit is contained in:
parent
11f5fb173d
commit
fa503bf630
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue