summaryrefslogtreecommitdiff
path: root/examples/c-analysed/c-analysed.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/c-analysed/c-analysed.c')
-rw-r--r--examples/c-analysed/c-analysed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/c-analysed/c-analysed.c b/examples/c-analysed/c-analysed.c
index 5d86acfb6..e7aa865db 100644
--- a/examples/c-analysed/c-analysed.c
+++ b/examples/c-analysed/c-analysed.c
@@ -150,7 +150,7 @@ static void csv_buf_add(csv_buf_t buf, size_t * const csv_buf_used, char const *
if (siz_len > 0 && str != NULL)
{
- len = MIN(BUFFER_REMAINING(*csv_buf_used), siz_len - 1);
+ len = MIN(BUFFER_REMAINING(*csv_buf_used), siz_len);
if (len == 0)
{
return;
@@ -621,5 +621,8 @@ int main(int argc, char ** argv)
daemonize_shutdown(pidfile);
closelog();
+ fflush(csv_fp);
+ fclose(csv_fp);
+
return retval;
}