summaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index c43cb47..f69ec70 100644
--- a/buffer.c
+++ b/buffer.c
@@ -214,8 +214,10 @@ buf_printf (struct buffer *buf, const char *format, ...)
return ret;
}
-void buf_puts(struct buffer *buf, const char *str)
+bool
+buf_puts(struct buffer *buf, const char *str)
{
+ int ret = false;
uint8_t *ptr = BEND (buf);
int cap = buf_forward_capacity (buf);
if (cap > 0)
@@ -223,7 +225,9 @@ void buf_puts(struct buffer *buf, const char *str)
strncpynt ((char *)ptr,str, cap);
*(buf->data + buf->capacity - 1) = 0; /* windows vsnprintf needs this */
buf->len += (int) strlen ((char *)ptr);
+ ret = true;
}
+ return ret;
}