Always use the compat functions
M · Makefile +5, -0 1@@ -21,6 +21,11 @@ DOC = \
2 TODO
3 HDR = compat.h
4
5+COMPATOBJ = \
6+ reallocarray.o\
7+ strlcat.o\
8+ strlcpy.o
9+
10 OBJ = ${SRC:.c=.o} ${COMPATOBJ}
11
12 all: $(BIN)
M · compat.h
+0, -21@@ -1,8 +1,6 @@
2-#ifdef COMPAT
3 #undef strlcat
4 size_t strlcat(char *, const char *, size_t);
5 #undef strlcpy
6 size_t strlcpy(char *, const char *, size_t);
7 #undef reallocarray
8 void *reallocarray(void *, size_t, size_t);
9-#endif
M · config.mk
+0, -5 1@@ -26,10 +26,5 @@ LDFLAGS = ${LIBS}
2 # -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE ${INCS}
3 #LDFLAGS = -static -s ${LIBS}
4
5-# uncomment for compat
6-CFLAGS += -DCOMPAT
7-# uncomment if your libc doesn't support reallocarray, strlcat, strlcpy.
8-COMPATOBJ = reallocarray.o strlcat.o strlcpy.o
9-
10 # compiler and linker
11 #CC = cc