summaryrefslogtreecommitdiff
path: root/src/sbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbuf.c')
-rw-r--r--src/sbuf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sbuf.c b/src/sbuf.c
index 640b283..53c1490 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -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)
{