We don't need to NUL terminate our sun_path.
Pointed out by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
This commit is contained in:
parent
d68b8e48a2
commit
0e30a8041e
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95";
|
||||
*/
|
||||
static const char rcsid[] =
|
||||
"$Id: syslog.c,v 1.14 1998/03/05 22:17:59 brian Exp $";
|
||||
"$Id: syslog.c,v 1.15 1998/03/06 02:12:02 brian Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -303,8 +303,7 @@ connectlog()
|
||||
SyslogAddr.sun_len = sizeof(SyslogAddr);
|
||||
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';
|
||||
sizeof SyslogAddr.sun_path);
|
||||
connected = connect(LogFile, (struct sockaddr *)&SyslogAddr,
|
||||
sizeof(SyslogAddr)) != -1;
|
||||
|
||||
@ -314,7 +313,7 @@ connectlog()
|
||||
* compatibility.
|
||||
*/
|
||||
(void)strncpy(SyslogAddr.sun_path, _PATH_OLDLOG,
|
||||
sizeof SyslogAddr.sun_path - 1);
|
||||
sizeof SyslogAddr.sun_path);
|
||||
connected = connect(LogFile,
|
||||
(struct sockaddr *)&SyslogAddr,
|
||||
sizeof(SyslogAddr)) != -1;
|
||||
|
Loading…
Reference in New Issue
Block a user