declare vars at the top of the block
This commit is contained in:
parent
ea6258ce0f
commit
3340aaeb4d
1 changed files with 6 additions and 3 deletions
|
@ -79,15 +79,18 @@ void fifo_menu_handler(int fd, void *d) {
|
||||||
num_realloc);
|
num_realloc);
|
||||||
|
|
||||||
if (num_read == 0) { /* eof */
|
if (num_read == 0) { /* eof */
|
||||||
|
xmlDocPtr doc;
|
||||||
|
xmlNodePtr node;
|
||||||
|
|
||||||
menu->invalid = TRUE;
|
menu->invalid = TRUE;
|
||||||
menu_clear(menu);
|
menu_clear(menu);
|
||||||
|
|
||||||
FIFO_MENU_DATA(menu)->buf[FIFO_MENU_DATA(menu)->buflen] = '\0';
|
FIFO_MENU_DATA(menu)->buf[FIFO_MENU_DATA(menu)->buflen] = '\0';
|
||||||
|
|
||||||
xmlDocPtr doc = xmlParseMemory(FIFO_MENU_DATA(menu)->buf,
|
doc = xmlParseMemory(FIFO_MENU_DATA(menu)->buf,
|
||||||
FIFO_MENU_DATA(menu)->buflen);
|
FIFO_MENU_DATA(menu)->buflen);
|
||||||
|
|
||||||
xmlNodePtr node = xmlDocGetRootElement(doc);
|
node = xmlDocGetRootElement(doc);
|
||||||
|
|
||||||
if (node &&
|
if (node &&
|
||||||
!xmlStrcasecmp(node->name, (const xmlChar*) "fifo_menu")) {
|
!xmlStrcasecmp(node->name, (const xmlChar*) "fifo_menu")) {
|
||||||
|
|
Loading…
Reference in a new issue