Fix encoding of last character at 7bit encoding function
To avoid the situation where the receiving entity confuses 7 binary zero pad
bits as the @ character, the carriage return or <CR> character shall be used
for padding in this situation.
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 9569cf3..fa77eae 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -241,6 +241,12 @@
result[z++] = cb;
shift++;
}
+ /* To avoid the situation where the receiving entity confuses 7 binary
+ * zero pad bits as the @ character, the carriage return or <CR>
+ * character (defined in subclause 7.1.1) shall be used for padding in
+ * this situation. */
+ if (shift == 7)
+ result[z - 1] |= 0x1a;
free(data);