diff --git a/src/fop.rs b/src/fop.rs index 061815e..0faa827 100644 --- a/src/fop.rs +++ b/src/fop.rs @@ -70,7 +70,10 @@ fn main() { }); let mut buf = String::new(); - let _ = stdin().read_to_string(&mut buf); + if let Err(e) = stdin().read_to_string(&mut buf) { + eprintln!("{}: {}", argv[0], e.strerror); + exit(EX_IOERR); + }; /* split the buffer by the delimiter (by default, '\u{1E}') */ let mut fields = buf.split(&d).collect::>();