summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-12-30 13:25:44 +0100
committerHarald Welte <laforge@gnumonks.org>2014-12-30 13:25:44 +0100
commitc13cf8bbd3a0650993b43e1cea071c02d0f00d8f (patch)
treebf998a377e46542957c7565f3912d1f9c9b85113
parentc993a07ceb8cff0226885d39c6af17f0f903e01a (diff)
SMS-CB: introduce and use GSM341_7BIT_PADDING
-rw-r--r--include/osmocom/gsm/protocol/gsm_03_41.h1
-rw-r--r--tests/smscb/gsm0341_test.c5
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);