summaryrefslogtreecommitdiffstats
path: root/dstring.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-06-10 03:02:39 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-06-10 03:02:39 -0400
commita3faa73f03a4d539de4c808d1a4f3b8ebc5ce537 (patch)
treef64b21a1459e4b9774cd27a888dd66a1ec0cdce6 /dstring.h
parenta6c25c7c74f762cb40639da0b9b98bfcf3f4c590 (diff)
downloadbfs-a3faa73f03a4d539de4c808d1a4f3b8ebc5ce537.tar.xz
printf: Fix embedded nul bytes
Fixes #26.
Diffstat (limited to 'dstring.h')
-rw-r--r--dstring.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/dstring.h b/dstring.h
index cd867ad..318bb0b 100644
--- a/dstring.h
+++ b/dstring.h
@@ -78,6 +78,17 @@ int dstrcat(char **dest, const char *src);
int dstrncat(char **dest, const char *src, size_t n);
/**
+ * Append a single character to a dynamic string.
+ *
+ * @param str
+ * The string to append to.
+ * @param c
+ * The character to append.
+ * @return 0 on success, -1 on failure.
+ */
+int dstrapp(char **str, char c);
+
+/**
* Free a dynamic string.
*
* @param dstr