Bugfix: when initializing buffer from data reset position afterwards

This commit is contained in:
Johannes Schriewer 2018-07-28 20:39:26 +02:00
parent fb938637cc
commit 3bd6a7d3e7

View file

@ -143,6 +143,7 @@ static inline Buffer *buffer_from_data_no_copy(char *data, size_t len) {
static inline Buffer *buffer_from_data_copy(char *data, size_t len) { static inline Buffer *buffer_from_data_copy(char *data, size_t len) {
Buffer *buffer = buffer_allocate(len); Buffer *buffer = buffer_allocate(len);
(void)buffer_copy_in(data, buffer, len); (void)buffer_copy_in(data, buffer, len);
buffer->position = 0;
return buffer; return buffer;
} }