Merge pull request #146 from elegantShock2258/main

Fixed errors in L:222 and L:585.
This commit is contained in:
TheDarkBug 2021-10-13 20:21:39 +02:00 committed by GitHub
commit 1ad023f49c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,7 +208,7 @@ void parse_config()
char homedir[512]; char homedir[512];
// opening and reading the config file // opening and reading the config file
FILE *config; FILE *config=NULL;
if (config_directory == NULL) if (config_directory == NULL)
{ {
if (getenv("HOME") != NULL) if (getenv("HOME") != NULL)
@ -581,6 +581,7 @@ void get_info()
FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r");
if (!host_model_info) if (!host_model_info)
host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r");
fclose(host_model_info);
#ifdef __FREEBSD__ #ifdef __FREEBSD__
host_model_info = popen("sysctl -a hw.hv_vendor", "r"); host_model_info = popen("sysctl -a hw.hv_vendor", "r");
while (fgets(line, sizeof(line), host_model_info)) while (fgets(line, sizeof(line), host_model_info))