From 922edc1162a5831c01eab8784b8f428da7121afd Mon Sep 17 00:00:00 2001 From: ShiinaSekiu <89997950+ShiinaSekiu@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:21:34 +0800 Subject: [PATCH] Fix buffer not flushing immediately on Windows platform (#58) --- src/jprint.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jprint.c b/src/jprint.c index a41040f..43295fc 100644 --- a/src/jprint.c +++ b/src/jprint.c @@ -27,6 +27,7 @@ void jprint_error(const char *function_name, const char *detail) cJSON_Delete(jroot); printf("%s\n", jstr); + fflush(stdout); free(jstr); } @@ -48,6 +49,7 @@ void jprint_progress(const char *function_name) cJSON_Delete(jroot); printf("%s\n", jstr); + fflush(stdout); free(jstr); } @@ -76,5 +78,6 @@ void jprint_success(cJSON *jdata) cJSON_Delete(jroot); printf("%s\n", jstr); + fflush(stdout); free(jstr); }