Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 1999 18:20:08 -0600
From:      Warner Losh <imp@village.org>
To:        Mike Smith <mike@smith.net.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: OpenBSD's strlcpy(3) and strlcat(3) 
Message-ID:  <199907160020.SAA01121@harmony.village.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>  

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907160020.SAA01121>