> On Jul 8, 2017, at 1:13 PM, Theo Buehler <[email protected]> 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?
> Moreover, there's another fprintf(stderr, ...) that you might want to
> convert
Whoops, thanks, new diff.
--
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();