pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38547?usp=email ) Change subject: tun: Use OSMO_TRLCPY_ARRAY ...................................................................... tun: Use OSMO_TRLCPY_ARRAY tun->devname buffer is already IFNAMSIZ bytes long, so simplify the code. Change-Id: I40b370f4152748d5acf6ee576462e54c9a46a8a3 --- M lib/tun.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/47/38547/1 diff --git a/lib/tun.c b/lib/tun.c index 89fe292..60d9b5e 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -44,6 +44,7 @@ #include <linux/if_tun.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/utils.h> #include "tun.h" #include "syserr.h" @@ -107,8 +108,7 @@ tun->addrs = 0; tun->tundev.fd = -1; - osmo_strlcpy(tun->devname, devname, IFNAMSIZ); - tun->devname[IFNAMSIZ - 1] = 0; + OSMO_STRLCPY_ARRAY(tun->devname, devname); return tun; } -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38547?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I40b370f4152748d5acf6ee576462e54c9a46a8a3 Gerrit-Change-Number: 38547 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de>