summaryrefslogtreecommitdiffstats
path: root/dstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'dstring.h')
-rw-r--r--dstring.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/dstring.h b/dstring.h
index 22476b9..19fd6d7 100644
--- a/dstring.h
+++ b/dstring.h
@@ -41,6 +41,16 @@ char *dstralloc(size_t capacity);
char *dstrdup(const char *str);
/**
+ * Create a length-limited dynamic copy of a string.
+ *
+ * @param str
+ * The string to copy.
+ * @param n
+ * The maximum number of characters to copy from str.
+ */
+char *dstrndup(const char *str, size_t n);
+
+/**
* Get a dynamic string's length.
*
* @param dstr