Change in osmo-iuh[master]: hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding it

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 30 13:24:02 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/21898 )


Change subject: hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding it
......................................................................

hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding it

Change-Id: I4c539168597187408c31b906fd57844e0f165c9b
---
M src/hnbgw.c
1 file changed, 3 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/98/21898/1

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 @@
 		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);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/21898
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I4c539168597187408c31b906fd57844e0f165c9b
Gerrit-Change-Number: 21898
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201230/e64b9349/attachment.htm>


More information about the gerrit-log mailing list