OCT 修正编码规范检查

This commit is contained in:
huangxin 2022-09-27 17:24:16 +08:00
parent 697c81b467
commit 99d7f1ff97
1 changed files with 6 additions and 3 deletions

View File

@ -1699,8 +1699,10 @@ MYDWORD chkaddr(data9 *req) {
#include <net/if_arp.h> #include <net/if_arp.h>
#pragma clang diagnostic push
#pragma ide diagnostic ignored "cert-err34-c"
int getHwAddr(char *buff, char *mac) { int getHwAddr(char *buff, char *mac) {
if (buff == NULL || mac == NULL) { if (buff == nullptr || mac == nullptr) {
return -1; return -1;
} }
@ -1712,14 +1714,15 @@ int getHwAddr(char *buff, char *mac) {
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
buff[i] = p[i]; buff[i] = (char)p[i];
} }
return 0; return 0;
} }
#pragma clang diagnostic pop
int arpSet(const char *ifname, char *ipStr, char *mac) { 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"); printf("para is null.\n");
return -1; return -1;
} }