X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Flttng-live%2Fviewer-connection.c;h=e8af3771b83c767929dfef58957551184a32ed85;hb=85e6a1160e1dc8564a7bf86a9099f77f62cace7e;hp=53358131fe9b9f0a707b0f27c4c1588ecd050627;hpb=0b6986b4940800145c85d72024b8ca10e6560c62;p=babeltrace.git diff --git a/src/plugins/ctf/lttng-live/viewer-connection.c b/src/plugins/ctf/lttng-live/viewer-connection.c index 53358131..e8af3771 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.c +++ b/src/plugins/ctf/lttng-live/viewer-connection.c @@ -304,7 +304,8 @@ int list_update_session(bt_value *results, const struct lttng_viewer_session *session, bool *_found, struct live_viewer_connection *viewer_connection) { - int i, len, ret = 0; + int ret = 0; + uint64_t i, len; bt_value *map = NULL; bt_value *hostname = NULL; bt_value *session_name = NULL; @@ -312,21 +313,11 @@ int list_update_session(bt_value *results, bool found = false; len = bt_value_array_get_length(results); - if (len < 0) { - BT_COMP_LOGE_STR("Error getting size of array."); - ret = -1; - goto end; - } for (i = 0; i < len; i++) { const char *hostname_str = NULL; const char *session_name_str = NULL; - map = bt_value_array_borrow_element_by_index(results, (size_t) i); - if (!map) { - BT_COMP_LOGE_STR("Error borrowing map."); - ret = -1; - goto end; - } + map = bt_value_array_borrow_element_by_index(results, i); hostname = bt_value_map_borrow_entry_value(map, "target-hostname"); if (!hostname) { BT_COMP_LOGE_STR("Error borrowing \"target-hostname\" entry.");