mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00:00
ncneofetch: don't read from NULL cpuinfo FILE
This commit is contained in:
parent
0ad87ef8bb
commit
c7c0909c17
@ -63,6 +63,10 @@ static distro_info distros[] = {
|
||||
static int
|
||||
fetch_cpu_info(fetched_info* fi){
|
||||
FILE* cpuinfo = fopen("/proc/cpuinfo", "re");
|
||||
if(cpuinfo == NULL){
|
||||
fprintf(stderr, "Error opening /proc/cpuinfo (%s)\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
char buf[BUFSIZ];
|
||||
while(fgets(buf, sizeof(buf), cpuinfo)){
|
||||
#define TAG "model name\t:"
|
||||
|
Loading…
Reference in New Issue
Block a user