Commit Graph

9 Commits

Author SHA1 Message Date
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dyoung bfa27930cb In sockaddr_snprintf(sbuf, len, fmt, sa), do not write the terminating
null character outside of the byte region [sbuf, sbuf + len).

1) If the length of the buffer is 0, do not write a null character
   at all.  Previously, sockaddr_snprintf() may have been able to
   overwrite sbuf[-1] if len was 0.

2) If the length of the buffer, len, is greater than 0, then write
   the null at sbuf[len - 1].  Previously, sockaddr_snprintf()
   wrote the null at buf[len - 1], where `buf' was a "cursor" that
   did not necessarily equal `sbuf', the start of the buffer.  Now,
   sockaddr_snprintf() always writes the null at sbuf[len - 1].
2007-07-24 08:45:45 +00:00
dyoung a26b3af0e0 Render the format %% as %. 2006-12-09 20:18:43 +00:00
elad 232f61fabb Lint warnings. 2005-08-27 16:55:59 +00:00
atatat a9321bb19a Add the 'A' and 'P' format specifiers which use getaddrinfo(3) to turn
numbers into names (if possible).  Also add the '?' format modifier
that elides the "N/A" if that's what you would normally get.
2005-04-09 02:05:47 +00:00
dyoung 4d24861fc9 For consistency of sockaddr_snprintf(3) with snprintf(3) and
snprintb(3), do not count the terminating NUL in the return value.
Update the regression tests to match.  Approved by christos@.
2005-01-13 00:44:25 +00:00
christos a5c1a01ed9 WARNS=3; fix cast-qual issues. 2004-12-11 06:41:15 +00:00
christos 09ad64e21f check for getnameinfo error correctly; thanks to Peter Postma. 2004-11-19 22:05:23 +00:00
christos eb6484700a Add sockaddr_snprintf; XXX: Needs a man page. 2004-11-19 21:37:19 +00:00