changeset 56:d4b5a6e547ca

fc-uicc-tool iccid command: same change as in fc-simtool
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 13 Feb 2021 19:45:04 +0000
parents 4c570522de5d
children 10030acba82f
files uicc/hlread.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/uicc/hlread.c	Sat Feb 13 19:42:14 2021 +0000
+++ b/uicc/hlread.c	Sat Feb 13 19:45:04 2021 +0000
@@ -11,7 +11,7 @@
 {
 	int rc;
 	unsigned len;
-	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);
 }