diff mbox series

[v3,1/4] test-parse-pathspec-file.c: s/0/NULL/ for pointer type

Message ID c9a1812abfc1d2ec804105b703f44639c0f8e3e7.1587996766.git.congdanhqx@gmail.com (mailing list archive)
State New, archived
Headers show
Series Partial fix `make sparse` | expand

Commit Message

Đoàn Trần Công Danh April 27, 2020, 2:22 p.m. UTC
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---

Notes:
    	struct foo val = { 0 };
    
    should be taken as idiom for zero-ing structured data.

    I think this should be written to CodingGuideline.
    I'll prepare a patch for this addition

 t/helper/test-parse-pathspec-file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/t/helper/test-parse-pathspec-file.c b/t/helper/test-parse-pathspec-file.c
index 02f4ccfd2a..b3e08cef4b 100644
--- a/t/helper/test-parse-pathspec-file.c
+++ b/t/helper/test-parse-pathspec-file.c
@@ -6,7 +6,7 @@ 
 int cmd__parse_pathspec_file(int argc, const char **argv)
 {
 	struct pathspec pathspec;
-	const char *pathspec_from_file = 0;
+	const char *pathspec_from_file = NULL;
 	int pathspec_file_nul = 0, i;
 
 	static const char *const usage[] = {
@@ -20,9 +20,9 @@  int cmd__parse_pathspec_file(int argc, const char **argv)
 		OPT_END()
 	};
 
-	parse_options(argc, argv, 0, options, usage, 0);
+	parse_options(argc, argv, NULL, options, usage, 0);
 
-	parse_pathspec_file(&pathspec, 0, 0, 0, pathspec_from_file,
+	parse_pathspec_file(&pathspec, 0, 0, NULL, pathspec_from_file,
 			    pathspec_file_nul);
 
 	for (i = 0; i < pathspec.nr; i++)