On Sat, Jul 08, 2017 at 01:56:09PM -0500, Scott Cheloha wrote:
> > On Jul 8, 2017, at 1:13 PM, Theo Buehler <t...@math.ethz.ch> wrote:
> > 
> > On Sat, Jul 08, 2017 at 10:27:43AM -0500, Scott Cheloha wrote:
> >> Just use warnx.
> > 
> > I don't have a real opinion on this one, but note that this changes
> > the output slightly.
> 
> Are you worried this will break something?

No, but your description sounded as if it was an equivalent replacement,
which it isn't.

> > Moreover, there's another fprintf(stderr, ...) that you might want to
> > convert
> 
> Whoops, thanks, new diff.

ok tb, if anyone wants to commit.

> 
> --
> Scott Cheloha
> 
> Index: games/grdc/grdc.c
> ===================================================================
> RCS file: /cvs/src/games/grdc/grdc.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 grdc.c
> --- games/grdc/grdc.c 7 Mar 2016 12:07:56 -0000       1.26
> +++ games/grdc/grdc.c 8 Jul 2017 18:47:02 -0000
> @@ -90,7 +90,7 @@ main(int argc, char *argv[])
>       if (argc == 1) {
>               n = strtonum(*argv, 1, INT_MAX, &errstr);
>               if (errstr) {
> -                     fprintf(stderr, "number of seconds is %s\n", errstr);
> +                     warnx("number of seconds is %s", errstr);
>                       usage();
>               }
>       }
> @@ -232,9 +232,7 @@ main(int argc, char *argv[])
>                       clear();
>                       refresh();
>                       endwin();
> -                     fprintf(stderr, "%s terminated by signal %d\n",
> -                         getprogname(), sigtermed);
> -                     return 1;
> +                     errx(1, "terminated by signal %d", sigtermed);
>               }
>       } while (n == 0 || nowtv.tv_sec < endtv.tv_sec);
>       standend();
> 

Reply via email to