From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <518935cf94deb137205a6f672a01c3ee@rei2.9hal> References: <518935cf94deb137205a6f672a01c3ee@rei2.9hal> Date: Sun, 9 Sep 2012 03:09:21 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7b33dc3050c74e04c93b542c Subject: Re: [9fans] dns Topicbox-Message-UUID: b79c1f52-ead7-11e9-9d60-3106f5b1d025 --047d7b33dc3050c74e04c93b542c Content-Type: text/plain; charset=UTF-8 it makes perfect sense: if the length of the path is NETPATHLEN, length of a string usually referring to non-zero bytes, you need to allow for the terminating zero byte. unfortunately, as you describe, it's a bit pointless because the dnsresolve callers rely on the manual page ("The path name is guaranteed to be less than 40 bytes long") and use an explicit constant 40 (others use something random, or know to use the undocumented NETPATHLEN). confusion! On 8 September 2012 23:27, wrote: > conn->dir has NETPATHLEN+1 capacity (why? makes no sense..). --047d7b33dc3050c74e04c93b542c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable it makes perfect sense: if the length of the path is NETPATHLEN, length of = a string usually referring to
non-zero bytes, you need to allow for the= terminating zero byte.
unfortunately, as you describe, it's a bit = pointless because the dnsresolve callers rely on the manual page
("The path name is=C2=A0guaranteed to be less than 40 bytes long&= quot;) and use an explicit constant 40
(others use something rand= om, or know to use the undocumented NETPATHLEN). confusion!

<= div class=3D"gmail_quote"> On 8 September 2012 23:27, <cinap_lenrek@gmx.de> wrote:
conn->dir has NETPATHLEN+1 capacity (why? makes no sense..).

--047d7b33dc3050c74e04c93b542c--