test lwm2m/engine: Fix build warning

Fix a build warning that is generated by new
enough compilers, when they detect the sprintf()
may overflow the destination buffer lenght.

The code which was generating the warnig was
actually not used, so we just remove it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-08-02 18:57:34 +02:00 committed by Carles Cufí
parent 6d2778e0c6
commit 957ea755bb

View file

@ -228,7 +228,6 @@ static void run_insertion_test(char const *insert_path_str[], int insertions_cou
/* WHEN: inserting each path */
struct lwm2m_obj_path insert_path;
char name[20];
for (int i = 0; i < insertions_count; ++i) {
ret = lwm2m_string_to_path(insert_path_str[i], &insert_path, '/');
@ -237,7 +236,6 @@ static void run_insertion_test(char const *insert_path_str[], int insertions_cou
ret = lwm2m_engine_add_path_to_list(&lwm2m_path_list, &lwm2m_path_free_list,
&insert_path);
sprintf(name, "Insertion: %d", i);
zassert_true(ret >= 0, "Insertion #%d failed", i);
/* THEN: path order is maintained */
assert_path_list_order(&lwm2m_path_list);