mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
ncneofetch: don't leak stderr from popen
This commit is contained in:
parent
108548e9dc
commit
8f089bc017
@ -100,7 +100,7 @@ pipe_getline(const char* cmdline){
|
||||
}
|
||||
char* buf = malloc(BUFSIZ); // gatesv("BUFSIZ bytes is enough for anyone")
|
||||
if(fgets(buf, BUFSIZ, p) == NULL){
|
||||
fprintf(stderr, "Error reading from %s (%s)\n", cmdline, strerror(errno));
|
||||
//fprintf(stderr, "Error reading from %s (%s)\n", cmdline, strerror(errno));
|
||||
fclose(p);
|
||||
free(buf);
|
||||
return NULL;
|
||||
@ -116,7 +116,7 @@ pipe_getline(const char* cmdline){
|
||||
|
||||
static int
|
||||
fetch_x_props(fetched_info* fi){
|
||||
char* xrandr = pipe_getline("xrandr --current");
|
||||
char* xrandr = pipe_getline("xrandr --current 2>/dev/null");
|
||||
if(xrandr == NULL){
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user