FreeCalypso > hg > sms-coding-utils
diff enc-text/gsm7.c @ 23:e56bb9f09ff1
sms-encode-text: port over -e option from fcup-smsend
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 02 Sep 2023 19:22:05 +0000 |
parents | 265b8103530c |
children |
line wrap: on
line diff
--- a/enc-text/gsm7.c Thu Aug 31 23:03:38 2023 +0000 +++ b/enc-text/gsm7.c Sat Sep 02 19:22:05 2023 +0000 @@ -10,7 +10,7 @@ #include <unistd.h> #include "defs.h" -extern int utf8_input; +extern int utf8_input, allow_escape; extern int concat_enable, concat_refno_set; extern char msgtext[MAX_MSG_CHARS*2+2]; extern u_char concat_refno; @@ -29,7 +29,7 @@ exit(1); } rc = latin1_to_gsm7(msgtext, msgtext_gsm7, MAX_MSG_CHARS, - &msgtext_gsmlen); + &msgtext_gsmlen, allow_escape); if (rc == -1) { fprintf(stderr, "error: message not valid for GSM7 charset\n"); exit(1); @@ -38,6 +38,11 @@ fprintf(stderr, "error: message too long for max concat SMS\n"); exit(1); } + if (rc == -3) { + fprintf(stderr, + "error: message contains invalid backslash escape\n"); + exit(1); + } if (msgtext_gsmlen <= 160) { fputs("dcs 0 septet\nmsg ", stdout); if (msgtext_gsmlen)