aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 3fec997..0ece6cc 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 f7f6bc0..a8e32d4 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);