On Sun, Nov 11, 2018 at 08:18:38AM -0600, Scott Cheloha wrote:
> This should print a warning and then _exit(2), not exit(3).
> I know you're "already here" but I might put that in a different
> patch. Don't know if it "fits" with the other patch content.
>
> Choice is yours, though maybe someone else will have an opinion.
Yes, this is subject of an upcoming diff.
> > @@ -276,7 +273,6 @@ parse_opts(int argc, char **argv, Displa
> > *dpy = XOpenDisplay(display);
> > if (!*dpy) {
> > errx(1, "Unable to open display %s", XDisplayName(display));
> > - /* NOTREACHED */
> > }
>
> For consistency with the rest of the program's style, drop the braces
> from the if-statement here.
Same here.
This diff only removes the comment to avoid annotate/blame noise.
An upcoming diff shuffles these lines.
> > /* Get server resources database. */
> > @@ -297,29 +293,26 @@ parse_opts(int argc, char **argv, Displa
> > __progname, &argc, argv);
> > if (argc > 1) {
> > usage();
> > - /* NOTREACHED */
> > }
>
> Same thing here.
See last comment.
> > if (getres(&value, rdb, "area", "Area")) {
> > - *area = strtol((char *)value.addr, &p, 10);
> > - if (*p || *area < 1) {
> > -fail: errx(1, "illegal value -- %s", (char
> > *)value.addr);
> > - /* NOTREACHED */
> > - }
> > + *area = strtonum(value.addr, 0, INT_MAX, &errstr);
> > + if (errstr)
> > + errx(1, "area is %s: %s", errstr, value.addr);
> > }
>
> The only serious issue: the original check was *area < 1, but now you
> allow *area to be 0. Typo?
1 is obviously correct, that's a typo on my site, thanks.