From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 15:41:17 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA39E106566B for ; Tue, 8 Nov 2011 15:41:17 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id A7D888FC08 for ; Tue, 8 Nov 2011 15:41:17 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id C53242A28CF0; Tue, 8 Nov 2011 16:40:46 +0100 (CET) Date: Tue, 8 Nov 2011 16:40:46 +0100 From: Ed Schouten To: Andrew Duane Message-ID: <20111108154046.GK2258@hoeg.nl> References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> <20111108113349.GG2258@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E9lJRGffXdNhqRfL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "rank1seeker@gmail.com" , Lucas Holt , "hackers@freebsd.org" Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:41:18 -0000 --E9lJRGffXdNhqRfL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andrew, * Andrew Duane , 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 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--