Cpu name fix (#39)

This commit is contained in:
TheDarkBug 2021-03-16 08:19:57 +01:00
parent 839458713a
commit 694a09a47d
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ build: uwufetch.c
debug: debug:
clear clear
gcc $(FLAGS_DEBUG) -o $(NAME) $(FILES) gcc $(FLAGS_DEBUG) -o $(NAME) $(FILES)
./uwufetch -d raspbian ./uwufetch
install: install:
cp $(NAME) $(INSTALL_DIR)$(NAME) cp $(NAME) $(INSTALL_DIR)$(NAME)

View file

@ -160,7 +160,7 @@ void get_info() { // get all necessary info
sscanf(line, "\nID=%s", version_name); sscanf(line, "\nID=%s", version_name);
if (strlen(version_name)) break; if (strlen(version_name)) break;
} }
while (fgets(line, sizeof(line), cpuinfo)) if (fscanf(cpuinfo, "model name : %[^with\n]", cpu_model)) break; while (fgets(line, sizeof(line), cpuinfo)) if (sscanf(line, "model name : %[^\n]", cpu_model)) break;
sprintf(user, "%s", getenv("USER")); sprintf(user, "%s", getenv("USER"));
fclose(os_release); fclose(os_release);
} else { // try for android vars, or unknown system } else { // try for android vars, or unknown system
@ -397,7 +397,7 @@ void usage(char* arg) {
" -h, --help prints this help page\n" " -h, --help prints this help page\n"
" -i, --image prints logo as image\n" " -i, --image prints logo as image\n"
" %sworks in most terminals\n" " %sworks in most terminals\n"
" read res/IMAGES.md for more info%s\n", " read res/IMAGES.md for more info%s\n"
" -l lists all supported distributions\n", " -l lists all supported distributions\n",
arg, BLUE, NORMAL); arg, BLUE, NORMAL);
} }