From owner-freebsd-hackers Thu Jul 15 15:54:26 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 1773D15640 for ; Thu, 15 Jul 1999 15:54:20 -0700 (PDT) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.02 #1) id 114uNN-000Kpp-00; Fri, 16 Jul 1999 00:53:13 +0200 From: Sheldon Hearn To: Tim Vanderhoek Cc: freebsd-hackers@FreeBSD.org Subject: Re: OpenBSD's strlcpy(3) and strlcat(3) In-reply-to: Your message of "Thu, 15 Jul 1999 18:34:42 -0400." <19990715183442.A53661@mad> Date: Fri, 16 Jul 1999 00:53:13 +0200 Message-ID: <80092.932079193@axl.noc.iafrica.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 15 Jul 1999 18:34:42 -0400, Tim Vanderhoek wrote: > if (fooncat(string, append, sizeof(string)) != strlen(append)) > ... > > which is rather evil, given that the second strlen(append) would be > completely gratuitous if it weren't for the interface you're > suggesting. Tim, you're doing that "I'm right, but too concise to be understood" thing again. What are you saying here? :-) If all you're saying is that you want an API that doesn't require a test against the known length of src (append in your example), then you won't like strl*. :-) You'd probably prefer the functions to return the number of bytes which they did not manage to {copy,append}, yes? Lazy bastard [1]. :-) While this might be something we add, it shouldn't be called strl{cpy,cat}. And the original question was whether or not we'd add the strl{cpy,cat} functions to libc. If we do, I seriously hope I'll be given the opportunity to submit a replacement manpage, since theirs sucks. Ciao, Sheldon. [1] It's usually the lazy guy who demands the best API, provided his demands are tempered by the pedantic guy. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message