forked from enlightenment/enlightenment
Fix raster fix
Use eina_strbuf_append_length, not eina_strbuf_append_n to add a string with known length. SVN revision: 57211
This commit is contained in:
parent
3320d11083
commit
67da66aacf
|
@ -184,7 +184,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
Ecore_Con_Event_Server_Data *ev;
|
Ecore_Con_Event_Server_Data *ev;
|
||||||
E_Event_Acpi *acpi_event;
|
E_Event_Acpi *acpi_event;
|
||||||
int sig, status, i, done = 0;
|
int sig, status, i, done = 0;
|
||||||
char device[1024], bus[1024], *sdata, *stmp;
|
char device[1024], bus[1024], *sdata;
|
||||||
const char *str, *p;
|
const char *str, *p;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
|
@ -198,10 +198,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
* a blob of data. copy to string and 0 byte terminate it so it can be
|
* a blob of data. copy to string and 0 byte terminate it so it can be
|
||||||
* string-swizzled/parsed etc. */
|
* string-swizzled/parsed etc. */
|
||||||
if (!acpibuf) acpibuf = eina_strbuf_new();
|
if (!acpibuf) acpibuf = eina_strbuf_new();
|
||||||
stmp = alloca(ev->size + 1);
|
eina_strbuf_append_length(acpibuf, ev->data, ev->size);
|
||||||
memcpy(stmp, ev->data, ev->size);
|
|
||||||
stmp[ev->size] = 0;
|
|
||||||
eina_strbuf_append_n(acpibuf, stmp, ev->size);
|
|
||||||
str = eina_strbuf_string_get(acpibuf);
|
str = eina_strbuf_string_get(acpibuf);
|
||||||
p = strchr(str, '\n');
|
p = strchr(str, '\n');
|
||||||
if (!p) return ECORE_CALLBACK_PASS_ON;
|
if (!p) return ECORE_CALLBACK_PASS_ON;
|
||||||
|
|
Loading…
Reference in New Issue