netcmds.c (216370) | netcmds.c (229403) |
---|---|
1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> 31 | 1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> 31 |
32__FBSDID("$FreeBSD: head/usr.bin/systat/netcmds.c 216370 2010-12-11 08:32:16Z joel $"); | 32__FBSDID("$FreeBSD: head/usr.bin/systat/netcmds.c 229403 2012-01-03 18:51:58Z ed $"); |
33 34#ifdef lint 35static const char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; 36#endif 37 38/* 39 * Common network command support routines. 40 */ --- 85 unchanged lines hidden (view full) --- 126changeitems(const char *args, int onoff) 127{ 128 char *cp, *tmpstr, *tmpstr1; 129 struct servent *sp; 130 struct hostent *hp; 131 struct in_addr in; 132 133 tmpstr = tmpstr1 = strdup(args); | 33 34#ifdef lint 35static const char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; 36#endif 37 38/* 39 * Common network command support routines. 40 */ --- 85 unchanged lines hidden (view full) --- 126changeitems(const char *args, int onoff) 127{ 128 char *cp, *tmpstr, *tmpstr1; 129 struct servent *sp; 130 struct hostent *hp; 131 struct in_addr in; 132 133 tmpstr = tmpstr1 = strdup(args); |
134 cp = index(tmpstr1, '\n'); | 134 cp = strchr(tmpstr1, '\n'); |
135 if (cp) 136 *cp = '\0'; 137 for (;;tmpstr1 = cp) { 138 for (cp = tmpstr1; *cp && isspace(*cp); cp++) 139 ; 140 tmpstr1 = cp; 141 for (; *cp && !isspace(*cp); cp++) 142 ; --- 167 unchanged lines hidden --- | 135 if (cp) 136 *cp = '\0'; 137 for (;;tmpstr1 = cp) { 138 for (cp = tmpstr1; *cp && isspace(*cp); cp++) 139 ; 140 tmpstr1 = cp; 141 for (; *cp && !isspace(*cp); cp++) 142 ; --- 167 unchanged lines hidden --- |