summaryrefslogtreecommitdiff
path: root/src/include/gnunet_strings_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r--src/include/gnunet_strings_lib.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index f43567611..db657f54e 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -541,6 +541,25 @@ GNUNET_STRINGS_get_utf8_args (int argc,
char *const **u8argv);
+/**
+ * Like strlcpy but portable. The given string @a src is copied in full length
+ * (until its null byte). The destination buffer is guaranteed to be
+ * null-terminated.
+ *
+ * to a destination buffer
+ * and ensures that the destination string is null-terminated.
+ *
+ * @param dst destination of the copy
+ * @param src source of the copy, must be null-terminated
+ * @param n the length of the string to copy, including its terminating null
+ * byte
+ * @return the length of the string that was copied, excluding the terminating
+ * null byte
+ */
+size_t
+GNUNET_strlcpy(char *dst, const char *src, size_t n);
+
+
/* ***************** IPv4/IPv6 parsing ****************** */
struct GNUNET_STRINGS_PortPolicy
@@ -641,7 +660,6 @@ struct GNUNET_STRINGS_IPv6NetworkPolicy *
GNUNET_STRINGS_parse_ipv6_policy (const char *routeListX);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif