feat: make renewable energy more affordable

This commit is contained in:
zhangsz committed 2025-03-05 14:40:19 +08:00
1 parent e9f1d06b36
commit 2617147be4
27 files changed
+66 -22

No files matched your search

+10 -4
View File
@@ -1779,10 +1779,16 @@ int wxc2_read_sysparam(void)
return 0;
}
temp_ptr = strchr(hostname,'-');
if (memcmp(ch_ptr,hostname,strlen(hostname)-strlen(temp_ptr)) != 0)
{
printf("The host name is unexpect!\n");
return 0;
if (temp_ptr != NULL) {
if (strncmp(ch_ptr, hostname, strlen(hostname) - strlen(temp_ptr)) != 0) {
printf("The host name is unexpected!\n");
return 0;
}
} else {
if (strncmp(ch_ptr, hostname, strlen(hostname)) != 0) {
printf("The host name is unexpected!\n");
return 0;
}
}
strcpy(temp_info,ch_ptr);
}