ecore_con - Fix binary buffer when using ECORE_CON_REMOTE_UDP.

ERR<7807>: lib/eina/eina_binbuf_template_c.x:95 eina_binbuf_append_length() *** Eina Magic Check Failed !!!
This fix a problem where eina_binbuf was used without
calling eina_binbuf_new when ECORE_CON_REMOTE_UDP is used.
This commit is contained in:
Nicolas Aguirre 2014-01-03 18:57:56 +01:00 committed by Guillaume Friloux
parent d31f21a288
commit 503e7a5b03
1 changed files with 14 additions and 12 deletions

View File

@ -799,7 +799,9 @@ ecore_con_client_send(Ecore_Con_Client *cl,
if (cl->host_server && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP))
sendto(cl->host_server->fd, data, size, 0, (struct sockaddr *)cl->client_addr,
cl->client_addr_len);
else if (!cl->buf)
else
{
if (!cl->buf)
{
cl->buf = eina_binbuf_new();
EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0);
@ -814,7 +816,7 @@ ecore_con_client_send(Ecore_Con_Client *cl,
#endif
}
eina_binbuf_append_length(cl->buf, data, size);
}
return size;
}