changeset 85:51167ee0151b

pb-update implementation: rm vestiges of uicc unification attempt
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 17 Feb 2021 06:35:55 +0000
parents 51f26fd967e2
children bd19dc7591ec
files simtool/pbupd_file.c
diffstat 1 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/pbupd_file.c	Wed Feb 17 06:15:15 2021 +0000
+++ b/simtool/pbupd_file.c	Wed Feb 17 06:35:55 2021 +0000
@@ -14,10 +14,8 @@
 extern char *alpha_from_file_hex();
 
 static
-process_record(line, pb_record_len, pb_record_count, filename_for_errs,
-		lineno_for_errs)
+process_record(line, filename_for_errs, lineno_for_errs)
 	char *line, *filename_for_errs;
-	unsigned pb_record_len, pb_record_count;
 {
 	unsigned recno;
 	u_char record[255], *fixp;
@@ -27,7 +25,7 @@
 	int c;
 
 	recno = strtoul(line+1, 0, 10);
-	if (recno < 1 || recno > pb_record_count) {
+	if (recno < 1 || recno > curfile_record_count) {
 		fprintf(stderr, "%s line %d: record number is out of range\n",
 			filename_for_errs, lineno_for_errs);
 		return(-1);
@@ -42,8 +40,8 @@
 	}
 	while (isspace(*cp))
 		cp++;
-	memset(record, 0xFF, pb_record_len);
-	fixp = record + pb_record_len - 14;
+	memset(record, 0xFF, curfile_record_len);
+	fixp = record + curfile_record_len - 14;
 	if (digit_char_to_gsm(*cp) < 0)
 		goto inv_syntax;
 	for (ndigits = 0; ; ndigits++) {
@@ -90,7 +88,8 @@
 	}
 	if (*cp == '"') {
 		cp++;
-		cp = alpha_from_file_qstring(cp, record, pb_record_len - 14,
+		cp = alpha_from_file_qstring(cp, record,
+					     curfile_record_len - 14,
 					     filename_for_errs,
 					     lineno_for_errs);
 		if (!cp)
@@ -99,7 +98,7 @@
 		cp += 3;
 		while (isspace(*cp))
 			cp++;
-		cp = alpha_from_file_hex(cp, record, pb_record_len - 14,
+		cp = alpha_from_file_hex(cp, record, curfile_record_len - 14,
 					 filename_for_errs, lineno_for_errs);
 		if (!cp)
 			return(-1);
@@ -109,7 +108,7 @@
 		cp++;
 	if (*cp)
 		goto inv_syntax;
-	return update_rec_op(recno, 0x04, record, pb_record_len);
+	return update_rec_op(recno, 0x04, record, curfile_record_len);
 }
 
 cmd_pb_update(argc, argv)
@@ -138,8 +137,7 @@
 		}
 		if (linebuf[0] != '#' || !isdigit(linebuf[1]))
 			continue;
-		rc = process_record(linebuf, curfile_record_len,
-				    curfile_record_count, argv[2], lineno);
+		rc = process_record(linebuf, argv[2], lineno);
 		if (rc < 0) {
 			fclose(inf);
 			return(rc);