diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-06-10 03:02:39 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-06-10 03:02:39 -0400 |
commit | a3faa73f03a4d539de4c808d1a4f3b8ebc5ce537 (patch) | |
tree | f64b21a1459e4b9774cd27a888dd66a1ec0cdce6 /dstring.c | |
parent | a6c25c7c74f762cb40639da0b9b98bfcf3f4c590 (diff) | |
download | bfs-a3faa73f03a4d539de4c808d1a4f3b8ebc5ce537.tar.xz |
printf: Fix embedded nul bytes
Fixes #26.
Diffstat (limited to 'dstring.c')
-rw-r--r-- | dstring.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -95,6 +95,10 @@ int dstrncat(char **dest, const char *src, size_t n) { return dstrcat_impl(dest, src, strnlen(src, n)); } +int dstrapp(char **str, char c) { + return dstrcat_impl(str, &c, 1); +} + void dstrfree(char *dstr) { if (dstr) { free(dstrheader(dstr)); |