changeset 599:18bfc10ba20e

sms-pdu-decode: more prep for pcm-sms-decode addition
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Feb 2020 01:20:45 +0000
parents 9f7a263ad7f0
children 31e219088cd6
files uptools/sms-pdu-decode/pdu-common.c uptools/sms-pdu-decode/sms-pdu-decode.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/uptools/sms-pdu-decode/pdu-common.c	Sat Feb 08 00:48:28 2020 +0000
+++ b/uptools/sms-pdu-decode/pdu-common.c	Sat Feb 08 01:20:45 2020 +0000
@@ -248,7 +248,7 @@
 	return(rc);
 }
 
-process_pdu()
+process_pdu(require_exact_length)
 {
 	unsigned udl, udl_octets;
 	unsigned udhl, udh_octets, udh_chars, ud_chars;
@@ -299,7 +299,7 @@
 		}
 		udl_octets = udl;
 	}
-	if (pdu_length - pdu_ptr != udl_octets) {
+	if (require_exact_length && pdu_length - pdu_ptr != udl_octets) {
 		printf("Decode-Error: UD length in PDU %u != expected %u\n",
 			pdu_length - pdu_ptr, udl_octets);
 		return(-1);
--- a/uptools/sms-pdu-decode/sms-pdu-decode.c	Sat Feb 08 00:48:28 2020 +0000
+++ b/uptools/sms-pdu-decode/sms-pdu-decode.c	Sat Feb 08 01:20:45 2020 +0000
@@ -88,7 +88,7 @@
 		pdu_length = cc;
 		if (keep_raw_pdu)
 			printf("%s\n\n", input_line);
-		process_pdu();
+		process_pdu(1);
 		putchar('\n');
 		swallow_empty_line();
 	}