diff options
Diffstat (limited to 'src/sbuf.c')
-rw-r--r-- | src/sbuf.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -69,9 +69,9 @@ sbuf_free_struct (struct sbuf *b) } char * -sbuf_concat (struct sbuf *b, const char *str) +sbuf_nconcat (struct sbuf *b, const char *str, int len) { - size_t minsz = b->len + strlen (str) + 1; + size_t minsz = b->len + len + 1; if (b->maxsz < minsz) { @@ -86,6 +86,13 @@ sbuf_concat (struct sbuf *b, const char *str) return b->data; } + +char * +sbuf_concat (struct sbuf *b, const char *str) +{ + return sbuf_nconcat (b, str, strlen (str)); +} + char * sbuf_copy (struct sbuf *b, const char *str) { |