From 99d7f1ff9709f2459ad8952db503c144ff1960c5 Mon Sep 17 00:00:00 2001 From: huangxin Date: Tue, 27 Sep 2022 17:24:16 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20=E4=BF=AE=E6=AD=A3=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/open_dhcp/opendhcpd.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/srcs/open_dhcp/opendhcpd.cpp b/srcs/open_dhcp/opendhcpd.cpp index 1c12002..8402ea3 100644 --- a/srcs/open_dhcp/opendhcpd.cpp +++ b/srcs/open_dhcp/opendhcpd.cpp @@ -1699,8 +1699,10 @@ MYDWORD chkaddr(data9 *req) { #include +#pragma clang diagnostic push +#pragma ide diagnostic ignored "cert-err34-c" int getHwAddr(char *buff, char *mac) { - if (buff == NULL || mac == NULL) { + if (buff == nullptr || mac == nullptr) { return -1; } @@ -1712,14 +1714,15 @@ int getHwAddr(char *buff, char *mac) { } for (i = 0; i < 6; i++) { - buff[i] = p[i]; + buff[i] = (char)p[i]; } return 0; } +#pragma clang diagnostic pop int arpSet(const char *ifname, char *ipStr, char *mac) { - if (ifname == NULL || ipStr == NULL || mac == NULL) { + if (ifname == nullptr || ipStr == nullptr || mac == nullptr) { printf("para is null.\n"); return -1; }