Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Mar 2001 14:58:53 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@Awfulhak.org
Subject:   Re: cvs commit: src/usr.bin/calendar io.c 
Message-ID:  <200103011458.f21Ewrx02627@hak.lan.Awfulhak.org>
In-Reply-To: Message from Warner Losh <imp@FreeBSD.org>  of "Wed, 28 Feb 2001 21:47:30 PST." <200103010547.f215lUw98788@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Ah good !  I've been looking for a reason to bring this up.

Does anybody (Garrett, Bruce?) know definitively which of the various 
*LEN variables include NUL ?  I think I know, but it's nice to pass 
it by people that may know better :)

MAXHOSTNAMELEN:
  Man pages seem to say that this is the limit for a host name length, 
  so it doesn't include the NUL, however sources such as dig call 
  gethostname with a variable exactly MAXHOSTNAMELEN big, and expect 
  the results to be NUL terminated.  char hostname[] as declared in 
  sys/kernel.h seems to be consistent with this, so I guess 
  MAXHOSTNAMELEN does include space for a NUL.

  man pages such as gethostname(3) should be fixed.

MAXNAMELEN:
  intro(2) suggests that this doesn't include space for a NUL - seems 
  right.

MAXPATHLEN
  intro(2) suggests that this does include space for a NUL - seems right.


> imp         2001/02/28 21:47:30 PST
> 
>   Modified files:
>     usr.bin/calendar     io.c 
>   Log:
>   MAXPATHLEN includes the trailing NUL character, so there's no need to add 1
>   to it for the size of path.
>   
>   Revision  Changes    Path
>   1.14      +2 -2      src/usr.bin/calendar/io.c

-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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