forked from enlightenment/efl
fix bug in example of assuming 0 termination of "data" as its not a
string. SVN revision: 74226
This commit is contained in:
parent
2ead8b85c2
commit
2fcec3db4b
|
@ -12,7 +12,16 @@ static Eina_Bool
|
||||||
_msg_from_child_handler(void *data, int type, void *event)
|
_msg_from_child_handler(void *data, int type, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Exe_Event_Data *dataFromProcess = (Ecore_Exe_Event_Data *)event;
|
Ecore_Exe_Event_Data *dataFromProcess = (Ecore_Exe_Event_Data *)event;
|
||||||
char *msg = (char *)dataFromProcess->data;
|
char msg[BUFFER_SIZE];
|
||||||
|
|
||||||
|
if (dataFromProcess->size >= (BUFFER_SIZE - 1))
|
||||||
|
{
|
||||||
|
fprintf(stdout, "Data too big for bugger. error\n");
|
||||||
|
return ECORE_CALLBACK_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(msg, dataFromProcess->data, dataFromProcess->size);
|
||||||
|
msg[dataFromProcess->size = 0;
|
||||||
|
|
||||||
if (strcmp(msg, "quit") == 0)
|
if (strcmp(msg, "quit") == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue