git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH] kset.h, tar.h: add missing header guard to prevent multiple inclusion
Date: Thu,  7 Nov 2019 10:12:43 +0000	[thread overview]
Message-ID: <20191107101243.99744-1-gitter.spiros@gmail.com> (raw)

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>
---
 kwset.h | 4 ++++
 tar.h   | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/kwset.h b/kwset.h
index df99a92178..f50ecae573 100644
--- 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 3467705e9b..6b258c4d4a 100644
--- 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 */
-- 
2.24.0.rc0.467.g566ccdd3e4.dirty


             reply	other threads:[~2019-11-07 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 10:12 Elia Pinto [this message]
2019-11-07 11:11 ` [PATCH] kset.h, tar.h: add missing header guard to prevent multiple inclusion Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191107101243.99744-1-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).