From owner-freebsd-security Thu Jul 15 17:17: 7 1999 Delivered-To: freebsd-security@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 76E38156EA for ; Thu, 15 Jul 1999 17:16:59 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id SAA29669; Thu, 15 Jul 1999 18:16:15 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id SAA01040; Thu, 15 Jul 1999 18:16:15 -0600 (MDT) Message-Id: <199907160016.SAA01040@harmony.village.org> To: Brett Glass Subject: Re: OpenBSD's strlcpy(3) and strlcat(3) Cc: Sheldon Hearn , Paul Hart , freebsd-security@FreeBSD.ORG In-reply-to: Your message of "Thu, 15 Jul 1999 18:05:06 MDT." <4.2.0.58.19990715180119.04723d20@localhost> References: <4.2.0.58.19990715180119.04723d20@localhost> Date: Thu, 15 Jul 1999 18:16:15 -0600 From: Warner Losh Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In message <4.2.0.58.19990715180119.04723d20@localhost> Brett Glass writes: : Or, even better, ALWAYS return the shortfall. The programmer can then discard : the return value if he's really willing to ignore it (perhaps at his peril). That's what strl* are defined to do. They always return the length of the string that would have resulted, had it not been truncated. That way it can either be used or ignored as the programmer sees fit. I don't see much value in computing return-value - size as another, incompatible argument. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message