Diff between 2878b49b8afcd2b05f355c9f22796bdf06e29c11 and a9e207e5a160e3d0fbfe9fa42beaba8527338031

Changed Files

File Additions Deletions Status
src/storage.c +16 -0 modified

Full Patch

diff --git a/src/storage.c b/src/storage.c
index babe7c7..e001987 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1195,6 +1195,22 @@ int delete_device_service(const bdaddr_t *sba, const bdaddr_t *dba)
 
 	g_slist_free_full(match.keys, g_free);
 
+	/* Deleting all CCC values of a given address */
+	memset(&match, 0, sizeof(match));
+	match.pattern = address;
+
+	create_filename(filename, PATH_MAX, sba, "ccc");
+	err = textfile_foreach(filename, filter_keys, &match);
+	if (err < 0)
+		return err;
+
+	for (l = match.keys; l; l = l->next) {
+		const char *key = l->data;
+		textfile_del(filename, key);
+	}
+
+	g_slist_free_full(match.keys, g_free);
+
 	return 0;
 }