settings: Fix scan-build warning
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 18 Oct 2022 21:23:50 +0000 (14:23 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:55 +0000 (14:55 +0530)
This fixes the following warning:

src/settings.c:281:7: warning: Branch condition evaluates to a garbage
value [core.uninitialized.Branch]
                if (ret) {
                    ^~~

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/settings.c

index 0f05300..85534f2 100644 (file)
@@ -269,6 +269,7 @@ static int gatt_db_load(struct gatt_db *db, GKeyFile *key_file, char **keys)
                                                        &primary, &uuid);
 
                        bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str));
+                       ret = 0;
                } else if (g_str_equal(type, GATT_INCLUDE_UUID_STR)) {
                        ret = load_incl(db, *handle, value, current_service);
                } else if (g_str_equal(type, GATT_CHARAC_UUID_STR)) {