From owner-freebsd-arch Wed Dec 13 21:59: 5 2000 From owner-freebsd-arch@FreeBSD.ORG Wed Dec 13 21:59:04 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from assaris.sics.se (h122n4fls32o892.telia.com [213.64.47.122]) by hub.freebsd.org (Postfix) with ESMTP id 158D337B400 for ; Wed, 13 Dec 2000 21:59:03 -0800 (PST) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id GAA76442; Thu, 14 Dec 2000 06:59:09 +0100 (CET) (envelope-from assar) Sender: assar@assaris.sics.se From: assar@FreeBSD.ORG To: Peter Pentchev Cc: arch@FreeBSD.ORG Subject: Re: add -I ignoremask option to du(1) References: <20001214034803.C575@ringworld.oblivion.bg> Date: 14 Dec 2000 06:59:08 +0100 In-Reply-To: Peter Pentchev's message of "Thu, 14 Dec 2000 03:48:04 +0200" Message-ID: <5lwvd3sfv7.fsf@assaris.sics.se> Lines: 16 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Peter Pentchev writes: > +void > +ignoreadd(mask) > + char *mask; > +{ > + char *newmask, **newign; > + unsigned l; > + > + l = strlen(mask) + 1; > + if (newmask = (char *) malloc(l + 1), newmask == NULL) > + err(1, "can't allocate memory"); > + strlcpy(newmask, mask, l+1); /* strcpy? playing it safe.. */ Why not newmask = strdup(mask); or even do the strdup:ing below ? /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message