aboutsummaryrefslogtreecommitdiffstats
path: root/tests/smscb
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2014-12-30 12:07:17 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2014-12-30 12:07:17 +0100
commitf626123f83675af8ea1ffd5d578dc40f71270bef (patch)
treeab4706cd88b575175a18c9a7cca5f7a18b0e0f2e /tests/smscb
parentbe4bbeb01b85cbe38c70e0f272e59e4c57f13aa2 (diff)
smscb/gsm0341_test: Add \r padding to the message
Diffstat (limited to 'tests/smscb')
-rw-r--r--tests/smscb/gsm0341_test.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/smscb/gsm0341_test.c b/tests/smscb/gsm0341_test.c
index cbd3721..73eddb5 100644
--- a/tests/smscb/gsm0341_test.c
+++ b/tests/smscb/gsm0341_test.c
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
{
uint16_t msg_id = GSM341_MSGID_ETWS_CMAS_MONTHLY_TEST;
char *text = "Mahlzeit!";
+ char tbuf[94];
if (argc > 1)
msg_id = atoi(argv[1]);
@@ -59,7 +60,12 @@ int main(int argc, char **argv)
if (argc > 2)
text = argv[2];
- gen_msg_from_text(msg_id, text);
+ strncpy(tbuf, text, 93);
+ if (strlen(text) < 93)
+ memset(tbuf+strlen(text), '\r', sizeof(tbuf)-strlen(text));
+ tbuf[93] = 0;
+
+ gen_msg_from_text(msg_id, tbuf);
return EXIT_SUCCESS;
}