From: Victor Julien Date: Fri, 19 Jul 2019 13:02:10 +0000 (+0200) Subject: device: remove duplicate length check X-Git-Tag: suricata-5.0.0-rc1~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7eff6ec500e68df2664d5909d219bbe7d8325e44;p=thirdparty%2Fsuricata.git device: remove duplicate length check Shorten code handles all cases correctly. --- diff --git a/src/util-device.c b/src/util-device.c index f1b3aaec10..1592d37b29 100644 --- a/src/util-device.c +++ b/src/util-device.c @@ -135,11 +135,7 @@ int LiveRegisterDevice(const char *dev) return -1; } /* create a short version to be used in thread names */ - if (strlen(pd->dev) > MAX_DEVNAME) { - LiveSafeDeviceName(pd->dev, pd->dev_short, sizeof(pd->dev_short)); - } else { - (void)strlcpy(pd->dev_short, pd->dev, sizeof(pd->dev_short)); - } + LiveSafeDeviceName(pd->dev, pd->dev_short, sizeof(pd->dev_short)); SC_ATOMIC_INIT(pd->pkts); SC_ATOMIC_INIT(pd->drop);