修改百度API地址
This commit is contained in:
6
cache.c
6
cache.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user