Date: Tue, 8 Nov 2011 16:40:46 +0100 From: Ed Schouten <ed@80386.nl> To: Andrew Duane <aduane@juniper.net> Cc: "rank1seeker@gmail.com" <rank1seeker@gmail.com>, Lucas Holt <luke@foolishgames.com>, "hackers@freebsd.org" <hackers@freebsd.org> Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn Message-ID: <20111108154046.GK2258@hoeg.nl> In-Reply-To: <AC6674AB7BC78549BB231821ABF7A9AEB80F4764EA@EMBX01-WF.jnpr.net> References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> <20111108113349.GG2258@hoeg.nl> <AC6674AB7BC78549BB231821ABF7A9AEB80F4764EA@EMBX01-WF.jnpr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--E9lJRGffXdNhqRfL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andrew, * Andrew Duane <aduane@juniper.net>, 20111108 16:22: > Checking the return code of strlcpy won't say if the entire string fit > (exactly) correctly, or if it was truncated. It seems they do: RETURN VALUES The strlcpy() and strlcat() functions return the total length of the string they tried to create. For strlcpy() that means the length of s= rc. For strlcat() that means the initial length of dst plus the length of src. While this may seem somewhat confusing, it was done to make trun= ca=E2=80=90 tion detection simple. --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ --E9lJRGffXdNhqRfL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOuU1+AAoJEG5e2P40kaK7bPUQAJZHsAXmT8ikeQRNl7Q3OvhG +8NuYcjX84ek79RlMX/usJkKDYybKd0aQh0cVI9PdPBbGDAzR83EgQYtSattj9Zk 4jAQX26Z+kvW6YZptrv9g2IOAPCw2bZBy+H4J0vJ8flGs1VqPu5FJbCiXKFb8Mk9 elz2DW8FGmBTNzNC3JHlXPLNT2tqnK8c7NivL8vcXt8vbbEBWh4M4rqs4vtLokoR l5v5HzmvXeyxSJp4tG1N4ZbahngNFB6mPrBfuCagHT4xcYdBLeK/KQXBtOPZRP0i +eZunhpf5N4wslR8wqhVNt5QoF2OinV5xjchv1UUNzbYPUmLb2o+sY2gAGKs6yvk 6GmQz5POEhs/16PhDK+KZMCE++PzOCURSUE8xgFDTALqkDLHXvV46dBRl4bwbjAq IslotOLZ6JSq3ozjerBP8zlWFVpaTHcwg5ICVqYjwMd36qQwJ6Q5ADk1aIchQkeg f81sooAQUEXkDA0h+cJ8F+fxVEe+mlJU+16c/MuRdtsb0KdMMhPC8VDCttsehWa7 VuFvqG5hJM0ej6U7f2na73p2RWFVVwcLPpc8nNHDxrYNyG8jOt+CzNtfhCMBSyj6 C9nPawYDJrHtWK9EsCVRYBddZVsGecWMKuW8APWyDlt4tL9hl6gJUnmYAfGtCJMF bi3CKiUzdgauciL+6ty/ =OHEQ -----END PGP SIGNATURE----- --E9lJRGffXdNhqRfL--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111108154046.GK2258>