aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-30 13:39:06 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-30 14:23:54 +0100
commitdc529f3d787ec9f1e2a68c9029bbb2b6c1fd9087 (patch)
treecb4b2f4286ca37eebd4b3d3e541d022f19a44707 /src
parent294610160d0353a3d659cd4e7272ebf806ffd924 (diff)
hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding it
Diffstat (limited to 'src')
-rw-r--r--src/hnbgw.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hnbgw.c b/src/hnbgw.c
index f18d2b1..dd157d7 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -195,10 +195,9 @@ struct ue_context *ue_context_alloc(struct hnb_context *hnb, const char *imsi,
return NULL;
ue->hnb = hnb;
- if (imsi) {
- strncpy(ue->imsi, imsi, sizeof(ue->imsi));
- ue->imsi[sizeof(ue->imsi)-1] = '\0';
- } else
+ if (imsi)
+ OSMO_STRLCPY_ARRAY(ue->imsi, imsi);
+ else
ue->imsi[0] = '\0';
ue->tmsi = tmsi;
ue->context_id = get_next_ue_ctx_id(hnb->gw);