diff options
Diffstat (limited to 'uxd.c')
-rw-r--r-- | uxd.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) { |