- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
Stopgap fix for PR 4225 by Matthias Scheler (rpc.statd doesn't run on m68k).
XXX This should be done in a different way. XXX
Matthias proposes to use a PMAP capable of mapping more than 256 MB
per user process (You can do this by changing your vm_param constants
even now).
However, statd could use saner data structure to save on address space
easily. E.g., most host names will be much smaller than the allocated
1024(+1 for trailing zero) bytes. Using variable length names would
allow, depending on environment, a factor of 30 more hosts per address
space.
Btw, if anybody really needs more than 16k hosts handled by statd, the
data structure is unsuable anyway; currently, the array of entries is
linearly searched. Something like a DB_BTREE should be used.