cosmetic: use osmo_strlcpy() everywhere
Shorten some code and make obvious to the reader that the string copy is done
in a safe way.
Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index a0af42b..83e17db 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -2360,8 +2360,7 @@
ggsn->peer = pp;
gtphub_port_ref_count_inc(pp);
- strncpy(ggsn->apn_oi_str, apn_oi_str, sizeof(ggsn->apn_oi_str));
- ggsn->apn_oi_str[sizeof(ggsn->apn_oi_str) - 1] = '\0';
+ osmo_strlcpy(ggsn->apn_oi_str, apn_oi_str, sizeof(ggsn->apn_oi_str));
ggsn->expiry_entry.del_cb = resolved_gssn_del_cb;
expiry_add(&hub->expire_slowly, &ggsn->expiry_entry, now);