fop(1): fixes unhandled i/o error

This commit is contained in:
Emma Tebibyte 2024-07-28 00:35:55 -06:00
parent d5d13b84a7
commit 09193a14d5
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -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::<Vec<&str>>();