buffer: add buffer_addsl() for literal strings

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-26 20:21:54 +02:00
parent 42bcd7288d
commit 6ff72afd90
1 changed files with 3 additions and 0 deletions

View File

@ -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.