On Sun, 06 Feb 2022 23:41:26 -0600, Scott Cheloha wrote:
> > On Feb 6, 2022, at 20:07, Todd C. Miller wrote:
> >
> > Since the input is opened read-only I don't see the point in checking
> > the fclose() return value. However, if you are going to do so, you
> > might as well combine it with
> On Feb 6, 2022, at 20:07, Todd C. Miller wrote:
>
> Since the input is opened read-only I don't see the point in checking
> the fclose() return value. However, if you are going to do so, you
> might as well combine it with the ferror() check. E.g.
>
>if (ferror(fp) || fclose(fp) ==
Since the input is opened read-only I don't see the point in checking
the fclose() return value. However, if you are going to do so, you
might as well combine it with the ferror() check. E.g.
if (ferror(fp) || fclose(fp) == EOF) {
warn("%s", name);
status
Add missing stdio error checks to head(1):
- Output errors are terminal. The output is always stdout.
- Input errors yield a warning and cause the program to fail
gracefully.
- Restructure the getc(3)/putchar(3) loop in head_file() to accomodate
checking for errors.
ok?
P.S.