strcpy(host, *args);
host[(sizeof host)-1] = 0; strncpy(host, *args, (sizeof host)-1);
arp_del(char **args){  char host[128];  struct arpreq req;  struct sockaddr sa;  int flags=0;#if HAVE_NEW_SIOCSARP  struct arpreq_old old_req;#endif  memset((char *) &req, 0, sizeof(req));  /* Resolve the host name. */  if (*args == NULL) {	fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_hostname, "arp: need host name\n"));	return(-1);  }  strcpy(host, *args);  if (ap->input(0, host, &sa) < 0) {	ap->herror(host);	return(-1);  }  /* If a host has more than one address, use the correct one! */  memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));  if (hw_set)   	req.arp_ha.sa_family=hw->type;    req.arp_flags=ATF_PERM;  args++;  while (*args != NULL) {	if (opt_v) fprintf(stderr,"args=%s\n",*args);	if (! strcmp(*args, "pub")) {		flags |= 1;		args++;		continue;	}	if (! strcmp(*args, "priv")) {		flags |= 2;		args++;		continue;	}	if (! strcmp(*args, "temp")) {		req.arp_flags &= ~ATF_PERM;		args++;		continue;	}	if (! strcmp(*args, "trail")) {		req.arp_flags |= ATF_USETRAILERS;		args++;		continue;	}	if (! strcmp(*args, "dontpub")) {#ifdef HAVE_ATF_DONTPUB		req.arp_flags |= ATF_DONTPUB;#else		ENOSUPP("arp", "ATF_DONTPUB");#endif		args++;		continue;	}	if (! strcmp(*args, "auto")) {#ifdef HAVE_ATF_MAGIC		req.arp_flags |= ATF_MAGIC; #else		ENOSUPP("arp", "ATF_MAGIC");#endif		args++;		continue;	}	if (! strcmp(*args, "dev")) {		if (*++args == NULL) usage();	    	strncpy(device,*args,sizeof(device)-1);		device[sizeof(device)-1]='\0';		args++;		continue;	}	if (! strcmp(*args, "netmask")) {		if (*++args == NULL) usage();	    	if (strcmp(*args,"255.255.255.255") != 0) {			strcpy(host, *args);			if (ap->input(0, host, &sa) < 0) {				ap->herror(host);				return(-1);			}			memcpy((char *) &req.arp_netmask, (char *) &sa,			sizeof(struct sockaddr));			req.arp_flags |= ATF_NETMASK;	        }	        args++;	        continue;        }	usage();  }  if (flags == 0)  	flags = 3;  	#if HAVE_NEW_SIOCSARP  strcpy(req.arp_dev,device);  /* Call the kernel. */  if (flags & 2) {  	if (opt_v)  fprintf(stderr,"arp: SIOCDARP(nopub)\n");  	if (ioctl(sockfd, SIOCDARP, &req) < 0) {		if (errno == EINVAL) {			if (opt_v)  fprintf(stderr,"arp: OLD_SIOCDARP(priv)\n");			memcpy((char *)&old_req,(char *)&req,sizeof(old_req));			if (ioctl(sockfd, OLD_SIOCDARP, &old_req) < 0) {				if (errno != ENXIO) {					perror("OLD_SIOCSARP(priv)");					return(-1);				}			} else {				return(0);			}		}		if (errno == ENXIO) {			if (flags & 1)				goto nopub;			printf(NLS_CATGETS(catfd, arpSet, arp_no_arp, 				"No ARP entry for %s\n"), host);			return(-1);		}		perror("SIOCDARP(priv)");		return(-1);  	}  }  if (flags & 1) {nopub:  	req.arp_flags |= ATF_PUBL;  	if (opt_v)  fprintf(stderr,"arp: SIOCDARP(pub)\n");  	if (ioctl(sockfd, SIOCDARP, &req) < 0) {		if (errno == EINVAL) {			if (opt_v)  fprintf(stderr,"arp: OLD_SIOCDARP(pub)\n");			memcpy((char *)&old_req,(char *)&req,sizeof(old_req));			if (ioctl(sockfd, OLD_SIOCDARP, &old_req) < 0) {				if (errno != ENXIO) {					perror("OLD_SIOCSARP(pub)");					return(-1);				}			} else {				return(0);			}		}		if (errno == ENXIO) {			printf(NLS_CATGETS(catfd, arpSet, arp_no_arp, 				"No ARP entry for %s\n"), host);			return(-1);		}		perror("SIOCDARP(pub)");		return(-1);  	}  }#else  /* Call the kernel. */  if (opt_v)  fprintf(stderr,"arp: old_SIOCDARP()\n");  if (ioctl(sockfd, SIOCDARP, &req) < 0) {	perror("SIOCDARP");	return(-1);  }#endif  return(0);}