From 745b8cf42046f40b51af86372dd45b63e5413f67 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Mon, 14 Jan 2019 11:14:20 +0100 Subject: [PATCH] added include guards to compatibility headers --- src/common/compat_strlcat.h | 11 ++++++++++- src/common/compat_strlcpy.h | 11 ++++++++++- src/common/compat_strnlen.h | 9 +++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/common/compat_strlcat.h b/src/common/compat_strlcat.h index d3cce7eb..f0284aca 100644 --- a/src/common/compat_strlcat.h +++ b/src/common/compat_strlcat.h @@ -1,9 +1,18 @@ /** * @file - * @brief prototypes of strlcpy()/strlcat() imported from OpenBSD + * @brief prototypes of strlcat() imported from OpenBSD */ +#ifndef __COMPAT_STRLCAT_H +#define __COMPAT_STRLCAT_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef HAVE_STRLCAT #include size_t strlcat(char *dst, const char *src, size_t siz); #endif + +#endif diff --git a/src/common/compat_strlcpy.h b/src/common/compat_strlcpy.h index d97e405c..5a6067fb 100644 --- a/src/common/compat_strlcpy.h +++ b/src/common/compat_strlcpy.h @@ -28,10 +28,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** * @file - * @brief prototypes of strlcpy()/strlcat() imported from OpenBSD + * @brief prototypes of strlcpy() imported from OpenBSD */ +#ifndef __COMPAT_STRLCPY_H +#define __COMPAT_STRLCPY_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef HAVE_STRLCPY #include size_t strlcpy(char *dst, const char *src, size_t siz); #endif + +#endif diff --git a/src/common/compat_strnlen.h b/src/common/compat_strnlen.h index dd9bc984..7c04180b 100644 --- a/src/common/compat_strnlen.h +++ b/src/common/compat_strnlen.h @@ -3,7 +3,16 @@ * @brief prototype of strnlen() from OpenBSD */ +#ifndef __COMPAT_STRNLEN_H +#define __COMPAT_STRNLEN_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef HAVE_STRNLEN #include size_t strnlen(const char *str, size_t maxlen); #endif + +#endif