Commit 65203b5af54e672b19db7fc3473db29513fabc7a

Patrick Steinhardt 2019-04-16T13:21:16

config_file: make use of `GIT_CONTAINER_OF` macro

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/config_file.c b/src/config_file.c
index 26c9e5e..a305021 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -227,9 +227,9 @@ static void backend_free(git_config_backend *_backend)
 
 static int config_iterator_new(
 	git_config_iterator **iter,
-	struct git_config_backend* backend)
+	struct git_config_backend *backend)
 {
-	diskfile_header *bh = (diskfile_header *) backend;
+	diskfile_header *bh = GIT_CONTAINER_OF(backend, diskfile_header, parent);
 	git_config_entries *entries;
 	int error;