From 1d2bdf995af658209f5fb63fc42c825411d8da9e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 27 Mar 2019 22:45:01 -0400 Subject: dstring: Add a dstrdup() function --- dstring.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'dstring.h') diff --git a/dstring.h b/dstring.h index d43a1f0..0374447 100644 --- a/dstring.h +++ b/dstring.h @@ -1,6 +1,6 @@ /**************************************************************************** * bfs * - * Copyright (C) 2016-2017 Tavian Barnes * + * Copyright (C) 2016-2019 Tavian Barnes * * * * Permission to use, copy, modify, and/or distribute this software for any * * purpose with or without fee is hereby granted. * @@ -31,6 +31,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. * -- cgit v1.2.3