# HG changeset patch # User Mychaela Falconia # Date 1613245334 0 # Node ID 4c570522de5d7929f151f3695dd4cdb865f24d94 # Parent 2d1679c7975b8cd56478a58f0ae4644784781880 fc-simtool iccid command: strip padding F digits from display diff -r 2d1679c7975b -r 4c570522de5d simtool/hlread.c --- a/simtool/hlread.c Sat Feb 13 06:44:34 2021 +0000 +++ b/simtool/hlread.c Sat Feb 13 19:42:14 2021 +0000 @@ -11,7 +11,7 @@ cmd_iccid() { int rc; - char buf[21]; + char buf[21], *cp; rc = select_op(FILEID_MF); if (rc < 0) @@ -30,7 +30,9 @@ if (rc < 0) return(rc); decode_reversed_nibbles(sim_resp_data, 10, buf); - buf[20] = '\0'; + for (cp = buf + 20; (cp > buf + 1) && (cp[-1] == 'F'); cp--) + ; + *cp = '\0'; printf("%s\n", buf); return(0); }