From owner-freebsd-hackers Fri Sep 7 15:31: 8 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by hub.freebsd.org (Postfix) with ESMTP id 5654437B407 for ; Fri, 7 Sep 2001 15:31:04 -0700 (PDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.11.1/8.11.1) id f87MWgh66289 for hackers@FreeBSD.ORG; Fri, 7 Sep 2001 18:32:42 -0400 (EDT) (envelope-from bicknell) Date: Fri, 7 Sep 2001 18:32:42 -0400 From: Leo Bicknell To: FreeBSD Hackers Subject: Re: tiny patch to pkg_add Message-ID: <20010907183242.A66179@ussenterprise.ufp.org> Mail-Followup-To: Leo Bicknell , FreeBSD Hackers References: <20010907150416.A38565@dub.net> <20010907151935.A40146@dub.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010907151935.A40146@dub.net>; from unfurl@dub.net on Fri, Sep 07, 2001 at 03:19:35PM -0700 Organization: United Federation of Planets Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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