From 6ff72afd904a5716370d0d28d4b24eef2750abbf Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 26 Apr 2009 20:21:54 +0200 Subject: [PATCH] buffer: add buffer_addsl() for literal strings Signed-off-by: Julien Danjou --- common/buffer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/buffer.h b/common/buffer.h index 45d627bc8..b1ee1936f 100644 --- a/common/buffer.h +++ b/common/buffer.h @@ -166,6 +166,9 @@ buffer_add(buffer_t *buf, const void *data, int len) buffer_splice(buf, buf->len, 0, data, len); } +#define buffer_addsl(buf, data) \ + buffer_add(buf, data, sizeof(data) - 1); + /** Add a string to the and of a buffer. * \param buf The buffer where to add. * \param s The string to add.