[3115] in Athena Bugs
/bin/od (RT & vax)
daemon@ATHENA.MIT.EDU (John Carr)
Wed Sep 6 20:50:08 1989
To: bugs@ATHENA.MIT.EDU
Date: Wed, 06 Sep 89 20:49:53 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
Probably present since we converted to BSD 4.3:
1. od is missing an "exit(0)" at the end of main (this is
fixed in 4.3 tahoe)
2. od does not check for input read errors
The following patch fixes both problems:
*** /paris/source/4.3/bin/od/od.c Tue Jan 19 21:20:17 1988
--- od.c Wed Sep 6 20:44:14 1989
***************
*** 345,350 ****
--- 345,355 ----
if (label >= 0)
label += n;
}
+ if(ferror(stdin)) {
+ fflush(stdout);
+ perror("read error");
+ exit(1);
+ }
/*
* Some conversions require "flushing".
***************
*** 360,365 ****
--- 365,371 ----
else
(*((*cv)->df_put))(0, *cv);
}
+ exit(0);
}
put_addr(a, l, c)