From 83a66f7288e3d2c330ccaeb5e14535711cee9d97 Mon Sep 17 00:00:00 2001 From: fumiama Date: Sat, 11 Sep 2021 23:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E5=BA=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmoe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmoe.c b/cmoe.c index d080944..d9bc5db 100644 --- a/cmoe.c +++ b/cmoe.c @@ -35,6 +35,7 @@ static void http_error(const char* type, const char* msg) { char* str = malloc(strlen(type) + strlen(msg)); uint32_t len = strlen(str); sprintf(str, type, msg); + fflush(stdout); write(1, (char*)&len, sizeof(uint32_t)); write(1, str, len); free(str); @@ -148,9 +149,10 @@ static void return_count(char* name, char* theme) { for(int i = 0; i < 10; i++) { printf(img_slot_front, w * i, w, h); int n = cntstr[i] - '0'; - write(1, theme_type[n], len_type[n]); + fwrite(theme_type[n], len_type[n], 1, stdout); printf(img_slot_rear); } + fflush(stdout); write(1, svg_tail, sizeof(svg_tail)-1); } free(spb);