summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1998-03-06 02:01:39 +0000
committerbrian <brian@cvs.openbsd.org>1998-03-06 02:01:39 +0000
commitddcdf4cdacb3bed046165708d16093c3bb0d3d97 (patch)
tree4ba3ef756b1b0b9a42219d97f750abd2e1e582d9 /lib/libc
parentd574a5c8dda7187702820f7918476b60329e8f17 (diff)
And terminate SyslogAddr.sun_path (duh!)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/syslog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 7185a6c215b..c6e3e34b1b2 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: syslog.c,v 1.6 1998/03/06 01:53:23 brian Exp $";
+static char rcsid[] = "$OpenBSD: syslog.c,v 1.7 1998/03/06 02:01:38 brian Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -255,6 +255,7 @@ openlog(ident, logstat, logfac)
SyslogAddr.sun_family = AF_UNIX;
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
sizeof(SyslogAddr.sun_path) - 1);
+ SyslogAddr.sun_path[sizeof(SyslogAddr.sun_path) - 1] = '\0';
if (LogStat & LOG_NDELAY) {
if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
return;