examples/efl_thread: fix oob writes

Summary: CIDs 1403896, 1403895, 1403892

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10395
This commit is contained in:
Mike Blumenkrantz 2019-10-24 14:50:27 +02:00 committed by Xavi Artigas
parent fbb8d83373
commit 408102427f
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ _th_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
Eina_Error err = efl_io_reader_read(obj, &rw_slice);
if (!err)
{
buf[rw_slice.len] = 0;
buf[rw_slice.len - 1] = 0;
printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
char *buf2 = "yes-im-here ";
@ -112,7 +112,7 @@ _read_change(void *data EINA_UNUSED, const Efl_Event *ev)
Eina_Error err = efl_io_reader_read(obj, &rw_slice);
if (!err)
{
buf[rw_slice.len] = 0;
buf[rw_slice.len - 1] = 0;
printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
}
}
@ -146,7 +146,7 @@ _stdin_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
Eina_Error err = efl_io_reader_read(obj, &rw_slice);
if (!err)
{
buf[rw_slice.len] = 0;
buf[rw_slice.len - 1] = 0;
printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
}
}