Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2000 13:36:23 -0500
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        Ben Smithurst <ben@scientia.demon.co.uk>
Cc:        Ryan Thompson <ryan@sasknow.com>, Zhihui Zhang <zzhang@cs.binghamton.edu>, freebsd-questions@FreeBSD.ORG
Subject:   Re: library routine used to read a configuration file
Message-ID:  <20000315133623.B59024@cc942873-a.ewndsr1.nj.home.com>
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 %2B0000
References:  <20000315001252.C56931@cc942873-a.ewndsr1.nj.home.com> <Pine.BSF.4.21.0003142332220.17508-100000@ren.sasknow.com> <20000315103735.B16722@strontium.scientia.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000315133623.B59024>