diff --git a/utils.c b/utils.c index b7aa3d9..1d7b5ac 100644 --- a/utils.c +++ b/utils.c @@ -2211,9 +2211,7 @@ char * strtok_r_e(char *str, const char *delim, char **saveptr) * plus the length of src. While this may seem somewhat confusing, * it was done to make truncation detection simple." */ -#if defined(__APPLE__) || defined(__MACH__) || defined(__APPLE_CC__) || defined(__FreeBSD__) || defined(__HAIKU__) || ((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 38)) || (__GLIBC__ >= 3) -/* nothing here */ -#else +#ifdef HAS_NO_STRLC int strlcpy(char *dst, const char *src, int sz) { int srclen; diff --git a/utils.h b/utils.h index f10ac82..ed7bc18 100644 --- a/utils.h +++ b/utils.h @@ -148,6 +148,7 @@ int t_lcm(int, int); /* returns least common multiple */ #if defined(__APPLE__) || defined(__MACH__) || defined(__APPLE_CC__) || defined(__FreeBSD__) || defined(__HAIKU__) || ((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 38)) || (__GLIBC__ >= 3) /* nothing here */ #else +#define HAS_NO_STRLC int strlcpy(char *, const char *, int); int strlcat(char *, const char *, int); #endif