Date: Mon, 21 Jul 2003 06:50:14 -0700 (PDT) From: Lukas Ertl <l.ertl@univie.ac.at> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/54672: [PATCH] fix gcc 3.3 compiler warning for ifconfig(8) Message-ID: <200307211350.h6LDoEfO023222@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/54672; it has been noted by GNATS. From: Lukas Ertl <l.ertl@univie.ac.at> To: Bruce Evans <bde@zeta.org.au> Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/54672: [PATCH] fix gcc 3.3 compiler warning for ifconfig(8) Date: Mon, 21 Jul 2003 15:43:24 +0200 (CEST) On Mon, 21 Jul 2003, Bruce Evans wrote: > On Mon, 21 Jul 2003, Lukas Ertl wrote: > > ... > > - u_short first = 123, last = 123; > > + u_int first = 123, last = 123; > > + char *p, *endptr; > > The new lines should be: > > char *endptr, *p; > u_long first, last; > > This fixes about 4 style bugs (initialization, indentation, inter-line order > and intra-line order) , and 1 overflow bug (see below). Ok, I guess I'm not too familiar with style(9) :-) > > + > > + if ((p = strchr(range, '-')) == NULL) > > + errx(1, "illegal range '%s'", range); > > strtoul() could be used to read up to the '-' more directly. > > There are complications for invalid formats with '-' signs in the > numbers. Both strtoul() and sscanf() will parse the '-' signs as > parts of numbers, but we don't want that here. I think we also > don't want any leading whitespace. So we need strchr(), don't we? regards, le -- Lukas Ertl eMail: l.ertl@univie.ac.at UNIX Systemadministrator Tel.: (+43 1) 4277-14073 Vienna University Computer Center Fax.: (+43 1) 4277-9140 University of Vienna http://mailbox.univie.ac.at/~le/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307211350.h6LDoEfO023222>