From dc451cd550396acd205e9522a2ecc7b191a8ff0d Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Sun, 13 Jun 2021 13:57:28 +0200 Subject: [PATCH] Fixed host info for termux --- uwufetch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index 1ac0fd6..6f30c62 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -375,9 +375,12 @@ void get_info() while (fgets(line, sizeof(line), os_release)) if (sscanf(line, "\nID=%s", version_name)) break; - while (fgets(line, sizeof(line), host_model_info)) - if (sscanf(line, "%[^\n]", host_model)) - break; + if (host_model_info) + { + while (fgets(line, sizeof(line), host_model_info)) + if (sscanf(line, "%[^\n]", host_model)) + break; + } } while (fgets(line, sizeof(line), cpuinfo)) if (sscanf(line, "model name : %[^\n]", cpu_model))