From d887b4742d551341ee9a61956dabbf49c419cd74 Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Sat, 30 Oct 2021 13:57:46 +0200 Subject: [PATCH] Fixed #154 --- uwufetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index 75863a2..562ac0f 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -580,8 +580,8 @@ void get_info() #endif FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); if (!host_model_info) - host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); - fclose(host_model_info); + if ((host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r")) != NULL) + fclose(host_model_info); #ifdef __FREEBSD__ host_model_info = popen("sysctl -a hw.hv_vendor", "r"); while (fgets(line, sizeof(line), host_model_info))