From 0b029582159e4080824a651c6b358f38cd5610ef Mon Sep 17 00:00:00 2001 From: Lukasz Wlazly Date: Mon, 23 Jan 2017 16:14:17 +0100 Subject: [PATCH] at_spi2_tool refactor Change-Id: I4140f479b95a1a5e91be3654f549ee845757db42 --- test/at_spi2_tool.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/at_spi2_tool.c b/test/at_spi2_tool.c index 594a7c8..743b90c 100644 --- a/test/at_spi2_tool.c +++ b/test/at_spi2_tool.c @@ -340,7 +340,7 @@ static char *_get_info(AtspiAccessible *node, int length_limit) _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM)); if (ret >= SAFE_BUFFER_SIZE) - fprintf(stderr, "\n_get_info: generated string is too long. Buffer overflow\n"); + fprintf(stderr, "\n%s, %s %s: generated string is too long. Buffer overflow\n", __FILE__, __FUNCTION__, __LINE__); free(node_name); free(node_role_name); @@ -436,8 +436,10 @@ static void _atspi_tree_traverse(AtspiAccessible *desktop, const char *app_name, bool app_name_matched = false; for (int i = 0; i < count; i++) { AtspiAccessible *child = atspi_accessible_get_child_at_index(desktop, i, NULL); - if (child == NULL) - break; + if (child == NULL) { + fprintf(stderr, "\n%s, %s %s: Null child occured. Results may be misleading.\n", __FILE__, __FUNCTION__, __LINE__); + continue; + } char *name = atspi_accessible_get_name(child, NULL); -- 2.7.4