diff options
author | ajs <ajs> | 2005-01-28 20:41:07 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-01-28 20:41:07 +0000 |
commit | 5c3d9816b7e02ecb0142d787b5416a489d717ee8 (patch) | |
tree | 0e5a3262eea6b94eefdd16b2c339ce3824485ce7 /lib/buffer.h | |
parent | 818cc87c6eeca942be55ed4082e3d7e53cdf8477 (diff) | |
download | quagga-5c3d9816b7e02ecb0142d787b5416a489d717ee8.tar.bz2 quagga-5c3d9816b7e02ecb0142d787b5416a489d717ee8.tar.xz |
2005-01-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* lib/buffer.h: Document behavior of buffer_getstr function.
* lib/buffer.c: (buffer_getstr) Fix bug: must handle case where
the string extends beyond the head struct buffer_data.
Diffstat (limited to 'lib/buffer.h')
-rw-r--r-- | lib/buffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/buffer.h b/lib/buffer.h index 65b8a8ca..c3787d78 100644 --- a/lib/buffer.h +++ b/lib/buffer.h @@ -65,7 +65,14 @@ struct buffer_data struct buffer *buffer_new (size_t); int buffer_write (struct buffer *, const void *, size_t); void buffer_free (struct buffer *); + +/* Combine all accumulated (and unflushed) data inside the buffer into a + single NUL-terminated string allocated using malloc (N.B. should be changed + to use XMALLOC(MTYPE_TMP)). Note that this function does not alter + the state of the buffer, so the data is still inside waiting to be + flushed. */ char *buffer_getstr (struct buffer *); + int buffer_putc (struct buffer *, u_char); int buffer_putstr (struct buffer *, const char *); void buffer_reset (struct buffer *); |