From 7c49ad7220c97fd5b42192d1168793b47008d10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 8 Jun 2021 14:13:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E7=84=B6=E5=8C=96=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmoe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmoe.c b/cmoe.c index 0a9a02d..a8eeb7d 100644 --- a/cmoe.c +++ b/cmoe.c @@ -98,7 +98,7 @@ static void return_count(char* name, char* theme) { FILE* fp = fopen(DATFILE, "rb+"); if(!fp) fp = fopen(DATFILE, "wb+"); if(fp) { - int ch, exist = 0; + int ch, exist = 0, user_exist = 0; while(has_next(fp, ch)) { SIMPLE_PB *spb = get_pb(fp); COUNTER *d = (COUNTER *)spb->target; @@ -144,14 +144,14 @@ static void return_count(char* name, char* theme) { fwrite(svg_tail, sizeof(svg_tail)-1, 1, stdout); fflush(stdout); } - fclose(fp); free(spb); - return; + user_exist = 1; + break; } } else free(spb); } fclose(fp); - http_error(HTTP404, "No Such User."); + if(!user_exist) http_error(HTTP404, "No Such User."); } else http_error(HTTP500, "Open File Error."); }