aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/buffer.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/util/buffer.c b/src/util/buffer.c
index d89565d68..8efb3e284 100644
--- a/src/util/buffer.c
+++ b/src/util/buffer.c
@@ -51,7 +51,8 @@ GNUNET_buffer_prealloc (struct GNUNET_Buffer *buf, size_t capacity)
51 * @param n number of bytes that should be available to write 51 * @param n number of bytes that should be available to write
52 */ 52 */
53void 53void
54GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf, size_t n) 54GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf,
55 size_t n)
55{ 56{
56 size_t new_capacity = buf->position + n; 57 size_t new_capacity = buf->position + n;
57 58
@@ -77,10 +78,11 @@ GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf, size_t n)
77 * @param buf buffer to write to 78 * @param buf buffer to write to
78 * @param data data to read from 79 * @param data data to read from
79 * @param len number of bytes to copy from @a data to @a buf 80 * @param len number of bytes to copy from @a data to @a buf
80 *
81 */ 81 */
82void 82void
83GNUNET_buffer_write (struct GNUNET_Buffer *buf, const char *data, size_t len) 83GNUNET_buffer_write (struct GNUNET_Buffer *buf,
84 const char *data,
85 size_t len)
84{ 86{
85 GNUNET_buffer_ensure_remaining (buf, len); 87 GNUNET_buffer_ensure_remaining (buf, len);
86 memcpy (buf->mem + buf->position, data, len); 88 memcpy (buf->mem + buf->position, data, len);
@@ -95,7 +97,8 @@ GNUNET_buffer_write (struct GNUNET_Buffer *buf, const char *data, size_t len)
95 * @param str the string to write to @a buf 97 * @param str the string to write to @a buf
96 */ 98 */
97void 99void
98GNUNET_buffer_write_str (struct GNUNET_Buffer *buf, const char *str) 100GNUNET_buffer_write_str (struct GNUNET_Buffer *buf,
101 const char *str)
99{ 102{
100 size_t len = strlen (str); 103 size_t len = strlen (str);
101 104
@@ -203,8 +206,8 @@ GNUNET_buffer_write_fstr (struct GNUNET_Buffer *buf, const char *fmt, ...)
203 */ 206 */
204void 207void
205GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf, 208GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf,
206 const char *fmt, 209 const char *fmt,
207 va_list args) 210 va_list args)
208{ 211{
209 int res; 212 int res;
210 va_list args2; 213 va_list args2;