V1.5: ICCID解析改为保留数字+大小写字母,最多20位(末位校验字符也保留)

This commit is contained in:
helei 2026-08-19 17:17:08 +08:00
parent cd2a3f7659
commit 1eaaea1867
1 changed files with 2 additions and 1 deletions

View File

@ -312,7 +312,8 @@ static int cat_connect_network(void) {
p += 7;
while (*p == ' ') p++;
int n = 0;
while (p[n] >= '0' && p[n] <= '9' && n < 19) n++; /* 只取 19 位卡号本体,末位校验字符(可能印成字母)不上传 */
while (n < 20 && ((p[n] >= '0' && p[n] <= '9') ||
(p[n] >= 'A' && p[n] <= 'Z') || (p[n] >= 'a' && p[n] <= 'z'))) n++; /* 数字+大小写字母都保留,最多 20 位 */
memcpy(s_iccid, p, n);
s_iccid[n] = 0;
}