From 97f061492e475fd612cebe7d5bc541748048a683 Mon Sep 17 00:00:00 2001 From: Jihoon Jung Date: Wed, 28 Jun 2023 16:48:25 +0900 Subject: [PATCH] Fix build error for toolchain upgrade Change-Id: Ia07ee3b284376d6fe5eff509f73ab1f4ce1001d2 Signed-off-by: Jihoon Jung --- src/zbl-dbus.c | 8 ++++++-- test/main.c | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/zbl-dbus.c b/src/zbl-dbus.c index 036d252..8eab712 100644 --- a/src/zbl-dbus.c +++ b/src/zbl-dbus.c @@ -6608,11 +6608,15 @@ int zbl_write_config_report(zb_zigbee_h handle, zb_nwk_addr addr16, DBG("change length = %d", len); DBG("payload length = %d", payload_len); - for (j = 0; j < len && (*records)[i].change+j; j++) { + if ((*records)[i].change == NULL) { + ERR("record[%d].change is NULL", i); + continue; + } + + for (j = 0; j < len; j++) { DBG("records[%d]->change[%d] = %d", i, j, (*records)[i].change[j]); g_variant_builder_add(rec_builder, "(y)", (*records)[i].change[j]); } - } rec_variant = g_variant_builder_end(rec_builder); g_variant_builder_unref(rec_builder); diff --git a/test/main.c b/test/main.c index 5eac0cd..1f71465 100644 --- a/test/main.c +++ b/test/main.c @@ -1304,15 +1304,15 @@ static int __select_handle_register_event(MManager *mm, struct menu_data *menu) handle, co_addr64 ); - if (ZIGBEE_ERROR_NONE != ret) + if (ZIGBEE_ERROR_NONE != ret) { msg("zb_get_controller_mac_address(%d) - FAILED!!! [%s]", ret, zigbee_error_to_string(ret)); - else + } else { msg(" Coordinator Address:"); msg(" %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", co_addr64[0], co_addr64[1], co_addr64[2], co_addr64[3], co_addr64[4], co_addr64[5], co_addr64[6], co_addr64[7]); - + } menu_manager_set_user_data(mm, handle); return RET_SUCCESS; -- 2.7.4