From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 13:49:40 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 6322F106566B; Tue, 4 Jan 2011 13:49:40 +0000 (UTC) Date: Tue, 4 Jan 2011 13:49:40 +0000 From: Alexander Best To: John Baldwin Message-ID: <20110104134940.GA8529@freebsd.org> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101040805.59412.jhb@freebsd.org> Cc: Kostik Belousov , freebsd-hackers@freebsd.org, hackers@freebsd.org, Giorgos Keramidas , Eitan Adler Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:49:40 -0000 On Tue Jan 4 11, John Baldwin wrote: > On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: > > On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > > @@ -123,12 +121,28 @@ main(argc, argv) > > } > > exit(0); > > } > > - exit (1); > > + exit(1); > > +} > > + > > +static int > > +parseint(const char *str, const char *errname) > > +{ > > + char *endp; > > + long res; > > + > > + errno = 0; > > + res = strtol(str, &endp, 10); > > + if (errno != 0 || endp == str || *endp != '\0') > > + err(1, "%s shall be a number", errname); > > Small nit, maybe use 'must' instead of 'shall'. it seems at some point there has been a massive usage of the term 'shall' in manual pages, which people tried to get rid of. hence the 'usr/share/examples/mdoc/deshallify.sh' script. maybe this should be noted in style(9)? cheers. alex > > -- > John Baldwin -- a13x