OCT 1. 简化代码

This commit is contained in:
huangxin 2023-03-06 09:11:42 +08:00
parent 9a0f34b168
commit c303960261
2 changed files with 18 additions and 22 deletions

View File

@ -5,7 +5,6 @@
#include <sys/file.h> #include <sys/file.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include "user_errno.h" #include "user_errno.h"
#include "misc.h" #include "misc.h"

View File

@ -550,15 +550,13 @@ static int delete_dhcpd_rangeset(const char **pRsp, const char *pRequest) {
} }
} }
//The input parameter does not exist //The input parameter does not exist
do {
PHASH_MAP s; PHASH_MAP s;
PHASH_MAP tmp; PHASH_MAP tmp;
char saddr[128]; char saddr[128];
char eaddr[128]; char eaddr[128];
char del_range[256]; char del_range[256];
memset(del_range, 0, 256); memset(del_range, 0, 256);
HASH_ITER(hh, delMap, s, tmp) HASH_ITER(hh, delMap, s, tmp) {
HASH_ITER(hh, delMap, s, tmp) {
cJSON *pdel_Item = cJSON_CreateObject(); cJSON *pdel_Item = cJSON_CreateObject();
IP2String(saddr, ntohl(s->key)); IP2String(saddr, ntohl(s->key));
IP2String(eaddr, ntohl(s->value)); IP2String(eaddr, ntohl(s->value));
@ -573,7 +571,6 @@ static int delete_dhcpd_rangeset(const char **pRsp, const char *pRequest) {
HASH_DEL(delMap, s); HASH_DEL(delMap, s);
free(s); free(s);
} }
} while (0);
//Rewrite cfig.dhcpRanges //Rewrite cfig.dhcpRanges
for (int i = 0; i < cfig.rangeCount; i++) { for (int i = 0; i < cfig.rangeCount; i++) {