summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/gsup.h
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-04-10 19:13:19 +0200
committerHarald Welte <laforge@gnumonks.org>2019-04-13 21:38:58 +0000
commit0ee798a0172a009cec4fb27c427b8f1d66fca749 (patch)
tree3989f2f5d206806c898a0a27d6358d71b3208995 /include/osmocom/gsm/gsup.h
parent469147480a9a36a10f650bdeda09d5d7e0e9f1e3 (diff)
add OSMO_IMSI_BUF_SIZE
Various places in our code base figure out how many chars they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually need a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_BUF_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770
Diffstat (limited to 'include/osmocom/gsm/gsup.h')
-rw-r--r--include/osmocom/gsm/gsup.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index 29ea11aa..9a583aae 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -232,7 +232,7 @@ struct osmo_gsup_pdp_info {
/*! parsed/decoded GSUP protocol message */
struct osmo_gsup_message {
enum osmo_gsup_message_type message_type;
- char imsi[GSM23003_IMSI_MAX_DIGITS+2];
+ char imsi[OSMO_IMSI_BUF_SIZE];
enum gsm48_gmm_cause cause;
enum osmo_gsup_cancel_type cancel_type;
int pdp_info_compl;