From a3136d5c0867584e93946004f727afdfd8670654 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: Wed, 2 Mar 2022 18:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA=E9=95=BF?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmoe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmoe.c b/cmoe.c index f740e30..73c17f6 100644 --- a/cmoe.c +++ b/cmoe.c @@ -118,9 +118,10 @@ static void return_count(char* name, char* theme) { sprintf(cntstrbuf, "%010u", d->count); free(spb); char* cntstr; - for(cntstr = (char*)cntstrbuf; cntstr < (char*)cntstrbuf+10; cntstr++) if(*cntstr != '0') break; - if(cntstr - (char*)cntstrbuf > 2) cntstr -= 2; // 保留 3 位 0 - else cntstr = cntstrbuf; // 保留所有 0 + for(int i = 0; i < 10; i++) if(cntstrbuf[i] != '0') { + cntstr = cntstrbuf+(i>2)?(i-2):0; + break; + } int isbig = 0; char** theme_type = mb; uint16_t* len_type = mbl;