string manipulation fixes. from openbsd

This commit is contained in:
itojun 2002-08-22 07:18:42 +00:00
parent 244d2b9f99
commit ea854da625
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: device.c,v 1.4 2002/07/13 11:35:35 itojun Exp $ */
/* $NetBSD: device.c,v 1.5 2002/08/22 07:18:42 itojun Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: device.c,v 1.4 2002/07/13 11:35:35 itojun Exp $");
__RCSID("$NetBSD: device.c,v 1.5 2002/08/22 07:18:42 itojun Exp $");
#endif
#include "os.h"
@ -105,7 +105,7 @@ deviceOpen(ifname, proto, trans)
{
struct if_info *p, tmp;
strcpy(tmp.if_name,ifname);
strlcpy(tmp.if_name, ifname, sizeof(tmp.if_name));
tmp.iopen = pfInit;
switch (proto) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: pf.c,v 1.6 2002/07/13 11:35:35 itojun Exp $ */
/* $NetBSD: pf.c,v 1.7 2002/08/22 07:18:42 itojun Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: pf.c,v 1.6 2002/07/13 11:35:35 itojun Exp $");
__RCSID("$NetBSD: pf.c,v 1.7 2002/08/22 07:18:42 itojun Exp $");
#endif
#include "os.h"
@ -159,7 +159,7 @@ pfAddMulti(s, interface, addr)
struct ifreq ifr;
int fd;
strcpy(ifr.ifr_name, interface);
strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name));
ifr.ifr_addr.sa_family = AF_UNSPEC;
memmove(ifr.ifr_addr.sa_data, addr, 6);
@ -194,7 +194,7 @@ pfDelMulti(s, interface, addr)
struct ifreq ifr;
int fd;
strcpy(ifr.ifr_name, interface);
strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name));
ifr.ifr_addr.sa_family = AF_UNSPEC;
memmove(ifr.ifr_addr.sa_data, addr, 6);