summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2008-10-26 11:37:11 +0100
committerJulien Cristau <jcristau@debian.org>2008-10-26 11:44:57 +0100
commit5244690a5e0285b6243ee1f28ae6c8287a32b73d (patch)
treea2ddb8d10e233bacd93632142664523c93441ba8
parenteadf90aa65d1ea63ddcd74e60e66a79ad567c7e8 (diff)
Add prototypes for strlcpy/strlcat
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/os.h5
-rw-r--r--os/strlcat.c1
-rw-r--r--os/strlcpy.c1
4 files changed, 10 insertions, 0 deletions
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 6c3d91c59..954a4284c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -72,6 +72,9 @@
/* Support SHM */
#undef HAS_SHM
+/* Have the 'strlcpy' function */
+#undef HAS_STRLCPY
+
/* Define to 1 if you have the <asm/mtrr.h> header file. */
#undef HAVE_ASM_MTRR_H
diff --git a/include/os.h b/include/os.h
index 7acc591f0..77e94486a 100644
--- a/include/os.h
+++ b/include/os.h
@@ -456,6 +456,11 @@ extern int xstrncasecmp(const char *s1, const char *s2, size_t n);
extern char *xstrcasestr(const char *s, const char *find);
#endif
+#ifndef HAS_STRLCPY
+extern size_t strlcpy(char *dst, const char *src, size_t siz);
+extern size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
+
/* Logging. */
typedef enum _LogParameter {
XLOG_FLUSH,
diff --git a/os/strlcat.c b/os/strlcat.c
index b57fcc563..91ceabb1c 100644
--- a/os/strlcat.c
+++ b/os/strlcat.c
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <string.h>
+#include "os.h"
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
diff --git a/os/strlcpy.c b/os/strlcpy.c
index 989d0385e..aa9d042e0 100644
--- a/os/strlcpy.c
+++ b/os/strlcpy.c
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <string.h>
+#include "os.h"
/*
* Copy src to string dst of size siz. At most siz-1 characters