修改百度API地址

This commit is contained in:
2025-07-23 14:27:02 +08:00
parent bd21381806
commit 1440451f8a
4 changed files with 6 additions and 5 deletions

View File

@@ -121,11 +121,13 @@ int is_ip_in_set(char cn_ip[MAXIPSET_][MAXIPLEN], const char *ip)
if (ip == NULL) {
return 0; // 错误无效的IP地址指针
}
for (int i = 0; i < MAXIPSET_; i++) {
if (cn_ip[i][0] != '\0' && strcmp(cn_ip[i], ip) == 0) {
return 1; // 找到匹配的IP地址
}
}
return 0; // 没有找到匹配的IP地址
}
@@ -145,10 +147,8 @@ int cn_ip_len(char cn_ip[MAXIPSET_][MAXIPLEN])
int truncate_file(const char *path)
{
int fd;
// 以只写模式打开文件并截断到0字节
fd = open(path, O_WRONLY | O_TRUNC);
int fd = open(path, O_WRONLY | O_TRUNC);
if (fd == -1) {
perror("truncate_file: Failed to open file");
return -1;