From owner-freebsd-questions Wed Mar 15 10:38: 9 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 053CE37C047 for ; Wed, 15 Mar 2000 10:37:19 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id NAA59448; Wed, 15 Mar 2000 13:36:23 -0500 (EST) (envelope-from cjc) Date: Wed, 15 Mar 2000 13:36:23 -0500 From: "Crist J. Clark" To: Ben Smithurst Cc: Ryan Thompson , Zhihui Zhang , freebsd-questions@FreeBSD.ORG Subject: Re: library routine used to read a configuration file Message-ID: <20000315133623.B59024@cc942873-a.ewndsr1.nj.home.com> Reply-To: cjclark@home.com References: <20000315001252.C56931@cc942873-a.ewndsr1.nj.home.com> <20000315103735.B16722@strontium.scientia.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000315103735.B16722@strontium.scientia.demon.co.uk>; from ben@scientia.demon.co.uk on Wed, Mar 15, 2000 at 10:37:35AM +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Mar 15, 2000 at 10:37:35AM +0000, Ben Smithurst wrote: > Ryan Thompson wrote: > > > Crist J. Clark wrote to Zhihui Zhang: > > > >> scanf(1) > > ^^^ > > > > scanf(3), certainly? Or did I miss something here? > > Don't use scanf, sscanf is safer according to everything I've read. First, yes, I meant scanf(3). Second, scanf, fscanf, sscanf, vscanf, vsscanf, and vfscanf all share the same manpage. And finally, sscanf is somewhat more secure since it pushes most of the risky step (reading input from a stream) to whatever function you use for that job (e.g. fgets(3)). -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message