From c13cf8bbd3a0650993b43e1cea071c02d0f00d8f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 30 Dec 2014 13:25:44 +0100 Subject: SMS-CB: introduce and use GSM341_7BIT_PADDING --- include/osmocom/gsm/protocol/gsm_03_41.h | 1 + tests/smscb/gsm0341_test.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/osmocom/gsm/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h index 3fec9976..0ece6ccf 100644 --- a/include/osmocom/gsm/protocol/gsm_03_41.h +++ b/include/osmocom/gsm/protocol/gsm_03_41.h @@ -8,6 +8,7 @@ #define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message)) #define GSM341_MAX_CHARS (GSM341_MAX_PAYLOAD*8/7) +#define GSM341_7BIT_PADDING '\r' /* Chapter 9.3.2 */ struct gsm341_ms_message { diff --git a/tests/smscb/gsm0341_test.c b/tests/smscb/gsm0341_test.c index f7f6bc02..a8e32d47 100644 --- a/tests/smscb/gsm0341_test.c +++ b/tests/smscb/gsm0341_test.c @@ -62,8 +62,9 @@ int main(int argc, char **argv) strncpy(tbuf, text, GSM341_MAX_CHARS); if (strlen(text) < GSM341_MAX_CHARS) - memset(tbuf+strlen(text), '\r', sizeof(tbuf)-strlen(text)); - tbuf[93] = 0; + memset(tbuf+strlen(text), GSM341_7BIT_PADDING, + sizeof(tbuf)-strlen(text)); + tbuf[GSM341_MAX_CHARS] = 0; gen_msg_from_text(msg_id, tbuf); -- cgit v1.2.3