1
0
mirror of https://github.com/fumiama/CMoe-Counter.git synced 2024-11-24 06:10:11 +01:00

优化显示长度

This commit is contained in:
源文雨 2022-03-02 18:15:47 +08:00
parent a3136d5c08
commit f8ada3eaa9

4
cmoe.c
View File

@ -117,9 +117,9 @@ static void return_count(char* name, char* theme) {
char cntstrbuf[11]; char cntstrbuf[11];
sprintf(cntstrbuf, "%010u", d->count); sprintf(cntstrbuf, "%010u", d->count);
free(spb); free(spb);
char* cntstr; char* cntstr = cntstrbuf;
for(int i = 0; i < 10; i++) if(cntstrbuf[i] != '0') { for(int i = 0; i < 10; i++) if(cntstrbuf[i] != '0') {
cntstr = cntstrbuf+(i>2)?(i-2):0; if(i > 2) cntstr = cntstrbuf+i-2;
break; break;
} }
int isbig = 0; int isbig = 0;