Date: 14 Dec 2000 06:59:08 +0100 From: assar@FreeBSD.ORG To: Peter Pentchev <roam@orbitel.bg> Cc: arch@FreeBSD.ORG Subject: Re: add -I ignoremask option to du(1) Message-ID: <5lwvd3sfv7.fsf@assaris.sics.se> In-Reply-To: Peter Pentchev's message of "Thu, 14 Dec 2000 03:48:04 %2B0200" References: <20001214034803.C575@ringworld.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
Peter Pentchev <roam@orbitel.bg> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5lwvd3sfv7.fsf>
