Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2001 18:32:42 -0400
From:      Leo Bicknell <bicknell@ufp.org>
To:        FreeBSD Hackers <hackers@FreeBSD.ORG>
Subject:   Re: tiny patch to pkg_add
Message-ID:  <20010907183242.A66179@ussenterprise.ufp.org>
In-Reply-To: <20010907151935.A40146@dub.net>; from unfurl@dub.net on Fri, Sep 07, 2001 at 03:19:35PM -0700
References:  <20010907150416.A38565@dub.net> <20010907151935.A40146@dub.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 07, 2001 at 03:19:35PM -0700, Bill Swingle wrote:
> On Fri, Sep 07, 2001 at 03:04:16PM -0700, Bill Swingle wrote:
> > -           strlcpy(packagesite, "", sizeof(packagesite));
> 
> Chris Costello recommended that I do this like this instead:
> 
> packagesite[0] = '\0'
> 
> Which seems to make sense since it lacks the overhead of strlcpy. Is
> there a "right" way to do this?

I think Chris's version is right, although if you're writing a
security app, or just want to be overly paranoid in general
you could use:

bzero((void *)packagesite, sizeof(packagesite));

-- 
Leo Bicknell - bicknell@ufp.org
Systems Engineer - Internetworking Engineer - CCIE 3440
Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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