bugfix: allocate one more zero-byte to definitely get a zero-terminated string
This commit is contained in:
parent
de0c13ba78
commit
67a6bd5589
|
@ -112,8 +112,9 @@ void ipc_shutdown() {
|
||||||
IPC_HANDLER(command) {
|
IPC_HANDLER(command) {
|
||||||
/* To get a properly terminated buffer, we copy
|
/* To get a properly terminated buffer, we copy
|
||||||
* message_size bytes out of the buffer */
|
* message_size bytes out of the buffer */
|
||||||
char *command = scalloc(message_size);
|
char *command = scalloc(message_size + 1);
|
||||||
strncpy(command, (const char*)message, message_size);
|
strncpy(command, (const char*)message, message_size);
|
||||||
|
LOG("IPC: received: *%s*\n", command);
|
||||||
parse_cmd((const char*)command);
|
parse_cmd((const char*)command);
|
||||||
tree_render();
|
tree_render();
|
||||||
free(command);
|
free(command);
|
||||||
|
|
Loading…
Reference in New Issue