# HG changeset patch # User Mychaela Falconia # Date 1581124845 0 # Node ID 18bfc10ba20ee287145e46edf71196cbbc394190 # Parent 9f7a263ad7f0393cb233dda6b14dddb45b75f997 sms-pdu-decode: more prep for pcm-sms-decode addition diff -r 9f7a263ad7f0 -r 18bfc10ba20e uptools/sms-pdu-decode/pdu-common.c --- 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); diff -r 9f7a263ad7f0 -r 18bfc10ba20e uptools/sms-pdu-decode/sms-pdu-decode.c --- 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(); }