lib/values.c: logging: log array size when out of bound
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 14 May 2017 04:22:54 +0000 (00:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:43 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/values.c

index c885412a7aae466fe2b58c0efdb611e03d34f506..600320bd068160622375388f0607c91a1da4f0ed 100644 (file)
@@ -1047,8 +1047,8 @@ struct bt_value *bt_value_array_get(const struct bt_value *array_obj,
 
        if (index >= typed_array_obj->garray->len) {
                BT_LOGW("Invalid parameter: index is out of bounds: "
-                       "addr=%p, index=%" PRIu64,
-                       array_obj, index);
+                       "addr=%p, index=%" PRIu64 ", size=%u",
+                       array_obj, index, typed_array_obj->garray->len);
                ret = NULL;
                goto end;
        }
@@ -1196,8 +1196,8 @@ enum bt_value_status bt_value_array_set(struct bt_value *array_obj,
 
        if (index >= typed_array_obj->garray->len) {
                BT_LOGW("Invalid parameter: index is out of bounds: "
-                       "addr=%p, index=%" PRIu64,
-                       array_obj, index);
+                       "addr=%p, index=%" PRIu64 ", size=%u",
+                       array_obj, index, typed_array_obj->garray->len);
                ret = BT_VALUE_STATUS_INVAL;
                goto end;
        }
@@ -1274,7 +1274,6 @@ struct bt_value *bt_value_map_get(const struct bt_value *map_obj,
 
        quark = g_quark_from_string(key);
        ret = g_hash_table_lookup(typed_map_obj->ght, GUINT_TO_POINTER(quark));
-
        if (ret) {
                bt_get(ret);
        }
This page took 0.025223 seconds and 4 git commands to generate.