diff uicc/hlread.c @ 61:97646b363eaa

fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 23 Mar 2021 06:07:06 +0000
parents b70d35f5476f
children
line wrap: on
line diff
--- a/uicc/hlread.c	Tue Mar 23 05:27:28 2021 +0000
+++ b/uicc/hlread.c	Tue Mar 23 06:07:06 2021 +0000
@@ -7,13 +7,12 @@
 #include "simresp.h"
 #include "file_id.h"
 
-cmd_iccid(argc, argv, outf)
-	char **argv;
-	FILE *outf;
+retrieve_iccid(buf)
+	char *buf;
 {
 	int rc;
 	unsigned len;
-	char buf[21], *cp;
+	char *cp;
 
 	rc = select_op(FILEID_MF);
 	if (rc < 0)
@@ -35,6 +34,19 @@
 	for (cp = buf + 20; (cp > buf + 1) && (cp[-1] == 'F'); cp--)
 		;
 	*cp = '\0';
+	return(0);
+}
+
+cmd_iccid(argc, argv, outf)
+	char **argv;
+	FILE *outf;
+{
+	int rc;
+	char buf[21];
+
+	rc = retrieve_iccid(buf);
+	if (rc < 0)
+		return(rc);
 	fprintf(outf, "%s\n", buf);
 	return(0);
 }