]> git.ipfire.org Git - thirdparty/git.git/commitdiff
kset.h, tar.h: add missing header guard to prevent multiple inclusion
authorElia Pinto <gitter.spiros@gmail.com>
Thu, 7 Nov 2019 10:12:43 +0000 (10:12 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Nov 2019 11:12:04 +0000 (20:12 +0900)
Add missing headers to prevent ill-effects from multiple inclusion.

Found by the LGTM source code analyzer.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
kwset.h
tar.h

diff --git a/kwset.h b/kwset.h
index df99a92178231a53b4b03d7ee1f4dc1d1988a0c8..f50ecae573b9ff77e0169fa93e733e68ef9fa300 100644 (file)
--- a/kwset.h
+++ b/kwset.h
@@ -1,3 +1,6 @@
+#ifndef KWSET_H
+#define KWSET_H
+
 /* This file has been copied from commit e7ac713d^ in the GNU grep git
  * repository. A few small changes have been made to adapt the code to
  * Git.
@@ -59,3 +62,4 @@ size_t kwsexec(kwset_t, char const *, size_t, struct kwsmatch *);
 /* Deallocate the given keyword set and all its associated storage. */
 void kwsfree(kwset_t);
 
+#endif /* KWSET_H */
diff --git a/tar.h b/tar.h
index 3467705e9b0e14a0230473186079e83a582e4345..6b258c4d4a3feb9f4a0319541f015baa41b122ae 100644 (file)
--- a/tar.h
+++ b/tar.h
@@ -1,3 +1,6 @@
+#ifndef TAR_H
+#define TAR_H
+
 #define TYPEFLAG_AUTO          '\0'
 #define TYPEFLAG_REG           '0'
 #define TYPEFLAG_LNK           '2'
@@ -23,3 +26,5 @@ struct ustar_header {
        char devminor[8];       /* 337 */
        char prefix[155];       /* 345 */
 };
+
+#endif /* TAR_H */