buffer: add buffer_addsl() for literal strings
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
42bcd7288d
commit
6ff72afd90
|
@ -166,6 +166,9 @@ buffer_add(buffer_t *buf, const void *data, int len)
|
||||||
buffer_splice(buf, buf->len, 0, data, 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.
|
/** Add a string to the and of a buffer.
|
||||||
* \param buf The buffer where to add.
|
* \param buf The buffer where to add.
|
||||||
* \param s The string to add.
|
* \param s The string to add.
|
||||||
|
|
Loading…
Reference in New Issue