mirror of
https://github.com/fumiama/CMoe-Counter.git
synced 2025-02-09 23:38:29 +01:00
自然化程序流程
This commit is contained in:
parent
e1532f56a7
commit
7c49ad7220
8
cmoe.c
8
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.");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user