Earlier hexdump printed unnecessary, and perhaps even misleading, 'bad
file descriptor' message.
$ hexdump foobar
hexdump: foobar: No such file or directory
hexdump: foobar: Bad file descriptor
The message is changed to
$ hexdump foobar
hexdump: foobar: No such file or directory
hexdump: all input file arguments failed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
#include "hexdump.h"
#include "xalloc.h"
#include "c.h"
+#include "nls.h"
static void doskip(const char *, int);
static u_char *get(void);
eaddress = address + nread;
return(curp);
}
+ if (fileno(stdin) == -1) {
+ warnx(_("all input file arguments failed"));
+ return(NULL);
+ }
n = fread((char *)curp + nread, sizeof(unsigned char),
length == -1 ? need : min(length, need), stdin);
if (!n) {