From owner-freebsd-hackers Thu Jul 15 16:40:11 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from gatekeeper.veriohosting.com (gatekeeper.veriohosting.com [192.41.0.2]) by hub.freebsd.org (Postfix) with ESMTP id 28B9415638 for ; Thu, 15 Jul 1999 16:40:07 -0700 (PDT) (envelope-from hart@iserver.com) Received: by gatekeeper.veriohosting.com; Thu, 15 Jul 1999 17:39:24 -0600 (MDT) Received: from unknown(192.168.1.109) by gatekeeper.veriohosting.com via smap (V3.1.1) id xma007354; Thu, 15 Jul 99 17:39:11 -0600 Received: (hart@localhost) by anchovy.orem.iserver.com (8.9.2) id RAA23182; Thu, 15 Jul 1999 17:38:16 -0600 (MDT) Date: Thu, 15 Jul 1999 17:38:16 -0600 (MDT) From: Paul Hart X-Sender: hart@anchovy.orem.iserver.com To: Mike Smith Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: OpenBSD's strlcpy(3) and strlcat(3) In-Reply-To: <199907152329.QAA01720@dingo.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 15 Jul 1999, Mike Smith wrote: > Ugh. Take the first example in the paper; it rewrites as > > len = asprintf(&path, "%s/.foorc"); > > as opposed to > > strlcat(path, homedir, sizeof(path)); > strlcat(path, "/", sizeof(path)); > strlcat(path, ".foord", sizeof(path)); > len = strlen(path); > > Yes, they're a better str*cat/cpy, but they're not the solution that > they claim to be. I don't think that anyone has intended them to be anything other than a better replacement for strcpy/strcat than strncpy/strncat (which they certainly are). Sure, you could go around telling people "use snprintf instead" or "use asprintf instead", but is that the issue at hand? Paul Hart -- Paul Robert Hart ><8> ><8> ><8> Verio Web Hosting, Inc. hart@iserver.com ><8> ><8> ><8> http://www.iserver.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message