From ad522fbffb612ce842abe8d7aa7ed130a442c9cb Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Sat, 5 Feb 2022 14:22:57 +0100 Subject: [PATCH] Fixed #188 --- uwufetch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uwufetch.c b/uwufetch.c index 1182e50..3540b1b 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -949,6 +949,11 @@ struct info get_info() if (os_release) { // get normal vars if os_release exists while (fgets(buffer, sizeof(buffer), os_release) && !(sscanf(buffer, "\nID=\"%s\"", user_info.os_name) || sscanf(buffer, "\nID=%s", user_info.os_name))) ; + // sometimes for some reason sscanf reads the last '\"' too + int os_name_len = strlen(user_info.os_name); + if (user_info.os_name[os_name_len - 1] == '\"') { + user_info.os_name[os_name_len - 1] = '\0'; + } /* trying to detect amogos because in its os-release file ID value is just "debian", will be removed when amogos will have an os-release file with ID=amogos */ if (strcmp(user_info.os_name, "debian") == 0 || strcmp(user_info.os_name, "raspbian") == 0) {