diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-11 20:34:23 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-18 15:07:02 +0200 |
| commit | 39b306f235f3faebb047c7cda82746781b9ea2f2 (patch) | |
| tree | ee32dadea6657c5313febe086bed1e7ae630d421 /buffer.h | |
| parent | 2c72e793c580d3ab149e7724a75b4be164c67aed (diff) | |
| download | vis-39b306f235f3faebb047c7cda82746781b9ea2f2.tar.gz vis-39b306f235f3faebb047c7cda82746781b9ea2f2.tar.xz | |
buffer: add utility function to NUL terminate buffer
Diffstat (limited to 'buffer.h')
| -rw-r--r-- | buffer.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -22,6 +22,8 @@ void buffer_clear(Buffer*); bool buffer_grow(Buffer*, size_t size); /* truncate buffer, but keep associated memory region for further data */ void buffer_truncate(Buffer*); +/* if buffer is not empty, make sure it is NUL terminated */ +bool buffer_terminate(Buffer*); /* replace buffer content with given data, growing the buffer if needed */ bool buffer_put(Buffer*, const void *data, size_t len); /* same but with NUL-terminated data */ |
