diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-09-03 17:07:58 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-09-03 17:11:12 -0400 |
commit | f7f1e3cfa25cf95e15bac30e6934d5a534ceca08 (patch) | |
tree | c5a15638ad3f26909114495bb43dcb62cf999ebd /dstring.h | |
parent | 325b37b290dda53392a22c7f2ef802f581e4232d (diff) | |
download | bfs-f7f1e3cfa25cf95e15bac30e6934d5a534ceca08.tar.xz |
dstring: New dstrndup() function
Diffstat (limited to 'dstring.h')
-rw-r--r-- | dstring.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |