diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-03-27 22:45:01 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-03-27 23:14:13 -0400 |
commit | 1d2bdf995af658209f5fb63fc42c825411d8da9e (patch) | |
tree | c38d9d0774ccf16a0b63b9eab5fa6ddd93808c19 /dstring.h | |
parent | ce5be644a16b3e4e7fdba0e0e4537daf3da70676 (diff) | |
download | bfs-1d2bdf995af658209f5fb63fc42c825411d8da9e.tar.xz |
dstring: Add a dstrdup() function
Diffstat (limited to 'dstring.h')
-rw-r--r-- | dstring.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,6 @@ /**************************************************************************** * bfs * - * Copyright (C) 2016-2017 Tavian Barnes <tavianator@tavianator.com> * + * Copyright (C) 2016-2019 Tavian Barnes <tavianator@tavianator.com> * * * * Permission to use, copy, modify, and/or distribute this software for any * * purpose with or without fee is hereby granted. * @@ -32,6 +32,14 @@ char *dstralloc(size_t capacity); /** + * Create a dynamic copy of a string. + * + * @param str + * The NUL-terminated string to copy. + */ +char *dstrdup(const char *str); + +/** * Get a dynamic string's length. * * @param dstr |