From owner-freebsd-hackers Thu Jul 15 17:20:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 9018A14D13 for ; Thu, 15 Jul 1999 17:20:13 -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 SAA29698; Thu, 15 Jul 1999 18:20:09 -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 SAA01121; Thu, 15 Jul 1999 18:20:09 -0600 (MDT) Message-Id: <199907160020.SAA01121@harmony.village.org> To: Mike Smith Subject: Re: OpenBSD's strlcpy(3) and strlcat(3) Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Thu, 15 Jul 1999 16:58:52 PDT." <199907152358.QAA01894@dingo.cdrom.com> References: <199907152358.QAA01894@dingo.cdrom.com> Date: Thu, 15 Jul 1999 18:20:08 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199907152358.QAA01894@dingo.cdrom.com> Mike Smith writes: : if (strlen(buf) >= sizeof(buf)) : return(error); This can never be true with the strl functions.... They don't run off the end, so strlen(buf) is always going to be < sizeof(buf) since it doesn't include the traling null. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message