aboutsummaryrefslogtreecommitdiff
path: root/uxd.c
diff options
context:
space:
mode:
Diffstat (limited to 'uxd.c')
-rw-r--r--uxd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/uxd.c b/uxd.c
index 1e81ac1..35dd2aa 100644
--- a/uxd.c
+++ b/uxd.c
@@ -191,8 +191,13 @@ void version(void) {
void open_input(const char *arg) {
if(!arg || (strcmp(arg, "-") == 0)) {
- input = stdin;
- freopen(NULL, "rb", stdin);
+ input = freopen(NULL, "rb", stdin);
+ if(!input) {
+ /* can this ever happen? */
+ fprintf(stderr, "%s: ", self);
+ perror("<stdin>");
+ exit(1);
+ }
} else {
input = fopen(arg, "rb");
if(!input) {