[hackers] [ubase] Guard against strlcpy()/strlcat() being implemented as macros || sin
commit a8e1ea139810054ffd25bd68f5d3a42bdbe1a058
Author: sin <sin_AT_2f30.org>
Date: Mon Feb 10 13:14:12 2014 +0000
Guard against strlcpy()/strlcat() being implemented as macros
diff --git a/util.h b/util.h
index a643205..c478579 100644
--- a/util.h
+++ b/util.h
_AT_@ -14,6 +14,8 @@ void eprintf(const char *, ...);
long estrtol(const char *, int);
void putword(const char *);
void recurse(const char *, void (*)(const char *));
+#undef strlcat
size_t strlcat(char *, const char *, size_t);
+#undef strlcpy
size_t strlcpy(char *, const char *, size_t);
char *ttytostr(int, int);
diff --git a/util/strlcat.c b/util/strlcat.c
index 71749e7..37379e7 100644
--- a/util/strlcat.c
+++ b/util/strlcat.c
_AT_@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
+#include "../util.h"
size_t
strlcat(char *dest, const char *src, size_t count)
diff --git a/util/strlcpy.c b/util/strlcpy.c
index f1b6e9e..4804d20 100644
--- a/util/strlcpy.c
+++ b/util/strlcpy.c
_AT_@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
+#include "../util.h"
size_t
strlcpy(char *dest, const char *src, size_t size)
Received on Mon Feb 10 2014 - 14:16:49 CET
This archive was generated by hypermail 2.3.0
: Mon Feb 10 2014 - 14:24:29 CET