changeset 800:8dc93aac9a9c

pcm-sms-decode & sms-pdu-decode: use new function for alphanumeric From/To addresses
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 25 Mar 2021 01:29:05 +0000
parents f023a1c187a9
children da724c67159d
files uptools/sms-pdu-decode/pdu-common.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/uptools/sms-pdu-decode/pdu-common.c	Thu Mar 25 01:26:28 2021 +0000
+++ b/uptools/sms-pdu-decode/pdu-common.c	Thu Mar 25 01:29:05 2021 +0000
@@ -68,7 +68,7 @@
 {
 	unsigned addr_field_len, alpha_nsep;
 	char digits[21];
-	u_char alpha_gsm7[11], alpha_decoded[23];
+	u_char alpha_gsm7[11];
 
 	if (pdu_ptr >= pdu_length) {
 		printf("Decode-Error: end of PDU before %s address\n",
@@ -91,11 +91,9 @@
 	else if ((pdu[pdu_ptr+1] & 0x70) == 0x50 &&
 		 alpha_addr_valid(pdu[pdu_ptr], &alpha_nsep)) {
 		gsm7_unpack(pdu + pdu_ptr + 2, alpha_gsm7, alpha_nsep);
-		gsm7_to_ascii_or_ext(alpha_gsm7, alpha_nsep, alpha_decoded,
-				     (unsigned *) 0, ascii_ext_mode, 0,
-				     (unsigned *) 0);
-		printf("%s: \"%s\" (type 0x%02X)\n", direction, alpha_decoded,
-			pdu[pdu_ptr+1]);
+		printf("%s: ", direction);
+		print_gsm7_string_to_file(alpha_gsm7, alpha_nsep, stdout);
+		printf(" (type 0x%02X)\n", pdu[pdu_ptr+1]);
 	} else {
 		decode_address_digits(pdu + pdu_ptr + 2, digits, pdu[pdu_ptr]);
 		printf("%s: %s%s (type 0x%02X)\n", direction,