sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit 802d765ffd723b0e3298d6f070bf5301ae0ddadd
parent e1eceee39ab489e5bc8ead2f8244b0cad3d1618f
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
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:
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: