client: use temp buffer for single output flush for json/disk util
[fio.git] / lib / output_buffer.c
index 313536dea97aa4f5277fb7634c0116bb5fcae1d7..beb8a1426a1a1e620fbe783f9e0648a95dd6c181 100644 (file)
@@ -1,4 +1,3 @@
-#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
@@ -17,6 +16,7 @@ void buf_output_init(struct buf_output *out)
 void buf_output_free(struct buf_output *out)
 {
        free(out->buf);
+       buf_output_init(out);
 }
 
 size_t buf_output_add(struct buf_output *out, const char *buf, size_t len)
@@ -39,11 +39,3 @@ size_t buf_output_add(struct buf_output *out, const char *buf, size_t len)
        out->buflen += len;
        return len;
 }
-
-void buf_output_clear(struct buf_output *out)
-{
-       if (out->buflen) {
-               memset(out->buf, 0, out->max_buflen);
-               out->buflen = 0;
-       }
-}