displaytextitem: check popen() - sacc - sacc(omys), simple console gopher client
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
Log
Files
Refs
Tags
LICENSE
---
commit 802d765ffd723b0e3298d6f070bf5301ae0ddadd
parent e1eceee39ab489e5bc8ead2f8244b0cad3d1618f
Author: Hiltjo Posthuma 
Date:   Sun, 25 Feb 2018 16:32:48 +0100

displaytextitem: check popen()

$PAGER is always set, but this might fail if resource limits or other
restrictions are set.

Diffstat:
  M sacc.c                              |       3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/sacc.c b/sacc.c
@@ -248,7 +248,8 @@ displaytextitem(Item *item)
                 return;
         case 0:
                 parent = 0;
-                pagerin = popen("$PAGER", "we");
+                if (!(pagerin = popen("$PAGER", "we")))
+                        _exit(1);
                 fputs(item->raw, pagerin);
                 exit(pclose(pagerin));
         default: