mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-09 22:50:38 +01:00
Chore: use ffStrCopyN instead of strlcpy
This commit is contained in:
@@ -231,7 +231,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
|
||||
FF_LIST_FOR_EACH(FFLocalIpResult, iface, *results)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
strlcpy(ifr.ifr_name, iface->name.chars, IFNAMSIZ);
|
||||
ffStrCopyN(ifr.ifr_name, iface->name.chars, IFNAMSIZ);
|
||||
|
||||
if (options->showType & FF_LOCALIP_TYPE_MTU_BIT)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
|
||||
iface->speed = (edata.speed_hi << 16) | edata.speed; // ethtool_cmd_speed is not available on Android
|
||||
#elif __FreeBSD__ || __APPLE__ || __OpenBSD__
|
||||
struct ifmediareq ifmr = {};
|
||||
strlcpy(ifmr.ifm_name, iface->name.chars, IFNAMSIZ);
|
||||
ffStrCopyN(ifmr.ifm_name, iface->name.chars, IFNAMSIZ);
|
||||
if (ioctl(sockfd, SIOCGIFMEDIA, &ifmr) == 0 && (IFM_TYPE(ifmr.ifm_active) & IFM_ETHER))
|
||||
{
|
||||
switch (IFM_SUBTYPE(ifmr.ifm_active))
|
||||
|
||||
Reference in New Issue
Block a user