1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00
freebsd/usr.sbin/syslogd
David Malone 98d1f19ba2 Here v->iov_len has been assigned the return value from snprintf.
Checking if it is > 0 doesn't make sense, because snprintf returns
how much space is needed if the buffer is too small. Instead, check
if the return value was greater than the buffer size, and truncate
the message if it was too long.

It isn't clear if snprintf can return a negative value in the case
of an error - I don't believe it can. If it can, then testing
v->iov_len won't help 'cos it is a size_t, not an ssize_t.

Also, as clang points out, we must always increment v here, because
later code depends on the message being in iov[5].
2011-01-19 17:17:37 +00:00
..
Makefile This isn't WARNS=6 safe. It fails to build on mips. Retore old 2010-08-08 02:45:14 +00:00
pathnames.h
syslog.conf.5 syslog.conf(5): correct example 2009-06-11 18:42:31 +00:00
syslogd.8 syslogd(8) already supports *sending* log messages to non- 2010-08-07 16:20:12 +00:00
syslogd.c Here v->iov_len has been assigned the return value from snprintf. 2011-01-19 17:17:37 +00:00