summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/smsutil.c4
-rw-r--r--src/smsutil.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/smsutil.c b/src/smsutil.c
index e41c0416..8d620f2b 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -2314,7 +2314,7 @@ static void sms_assembly_load(struct sms_assembly *assembly,
const struct dirent *dir)
{
struct sms_address addr;
- char straddr[25];
+ DECLARE_SMS_ADDR_STR(straddr);
guint16 ref;
guint8 max;
guint8 seq;
@@ -2391,7 +2391,7 @@ static gboolean sms_assembly_store(struct sms_assembly *assembly,
{
unsigned char buf[177];
int len;
- char straddr[25];
+ DECLARE_SMS_ADDR_STR(straddr);
if (!assembly->imsi)
return FALSE;
diff --git a/src/smsutil.h b/src/smsutil.h
index 66ef6f8d..630fde48 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -432,6 +432,12 @@ gboolean sms_decode_unpacked_stk_pdu(const unsigned char *pdu, int len,
gboolean sms_encode(const struct sms *in, int *len, int *tpdu_len,
unsigned char *pdu);
+/*
+ * Length is based on the address being 12 hex characters plus a
+ * terminating NUL char. See sms_assembly_extract_address().
+ */
+#define DECLARE_SMS_ADDR_STR(a) char a[25]
+
gboolean sms_decode_address_field(const unsigned char *pdu, int len,
int *offset, gboolean sc,
struct sms_address *out);