summaryrefslogtreecommitdiff
path: root/src/lib/string/compat_string.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-22 11:18:19 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-22 11:18:19 -0400
commit90a09df5ba7b3e55ea388a4cc9b92161442bb380 (patch)
tree1e50692d10ede2ddcf2c8b271a9c086c0a7d189e /src/lib/string/compat_string.c
parentbfb39164ce49450fad11611a129dd875acebde54 (diff)
downloadtor-90a09df5ba7b3e55ea388a4cc9b92161442bb380.tar.gz
tor-90a09df5ba7b3e55ea388a4cc9b92161442bb380.zip
Extract strlcpy and strlcmp to libtor-string
Diffstat (limited to 'src/lib/string/compat_string.c')
-rw-r--r--src/lib/string/compat_string.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/string/compat_string.c b/src/lib/string/compat_string.c
new file mode 100644
index 0000000000..6df1bc4a1d
--- /dev/null
+++ b/src/lib/string/compat_string.c
@@ -0,0 +1,14 @@
+/* Copyright (c) 2003-2004, Roger Dingledine
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#include "lib/string/compat_string.h"
+
+/* Inline the strl functions if the platform doesn't have them. */
+#ifndef HAVE_STRLCPY
+#include "strlcpy.c"
+#endif
+#ifndef HAVE_STRLCAT
+#include "strlcat.c"
+#endif