diff --git a/serial/toml.c b/serial/toml.c index 5d4d8f6..ee5a894 100644 --- a/serial/toml.c +++ b/serial/toml.c @@ -226,8 +226,7 @@ static enum b_status refill_linebuf(struct ctx *ctx) return status; } - b_string_clear(ctx->ctx_linebuf); - status = b_string_append_cstr(ctx->ctx_linebuf, b_stringstream_ptr(buf)); + status = b_string_replace_all_with_stringstream(ctx->ctx_linebuf, buf); if (!B_OK(status)) { return status; }