summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa187d6)
raw | patch | inline | side by side (parent: fa187d6)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 24 Jul 2006 21:35:41 +0000 (23:35 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Mon, 24 Jul 2006 21:35:41 +0000 (23:35 +0200) |
12:12 < kahmalo> Opening /dev/tty may fail; what does newterm do then?
20:15 < Miciah> fonseca: You always gotta check the return value of fopen. Silly head.
20:15 < Miciah> fonseca: You always gotta check the return value of fopen. Silly head.
tig.c | patch | blob | history |
index 8bae0d5b7e1f897a6db4b4566b20247e9cf3e7b4..6a1f3d1280a894fc8afabd22d0a96f694c587824 100644 (file)
--- a/tig.c
+++ b/tig.c
/* Leave stdin and stdout alone when acting as a pager. */
FILE *io = fopen("/dev/tty", "r+");
+ if (!io)
+ die("Failed to open /dev/tty");
cursed = !!newterm(NULL, io, io);
}