Deleted Added
full compact
getnetbynis.c (211276) getnetbynis.c (229403)
1/*-
2 * Copyright (c) 1994, Garrett Wollman
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994, Garrett Wollman
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/lib/libc/net/getnetbynis.c 211276 2010-08-13 06:39:54Z ume $");
27__FBSDID("$FreeBSD: head/lib/libc/net/getnetbynis.c 229403 2012-01-03 18:51:58Z ed $");
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <netdb.h>
34#include <resolv.h>
35#include <stdio.h>

--- 39 unchanged lines hidden (view full) ---

75 &resultlen))
76 return (-1);
77
78 bcopy((char *)result, (char *)&ypbuf, resultlen);
79 ypbuf[resultlen] = '\0';
80 free(result);
81 result = (char *)&ypbuf;
82
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <netdb.h>
34#include <resolv.h>
35#include <stdio.h>

--- 39 unchanged lines hidden (view full) ---

75 &resultlen))
76 return (-1);
77
78 bcopy((char *)result, (char *)&ypbuf, resultlen);
79 ypbuf[resultlen] = '\0';
80 free(result);
81 result = (char *)&ypbuf;
82
83 if ((cp = index(result, '\n')))
83 if ((cp = strchr(result, '\n')))
84 *cp = '\0';
85
86 cp = strpbrk(result, " \t");
87 *cp++ = '\0';
88 bp = ned->netbuf;
89 ep = ned->netbuf + sizeof ned->netbuf;
90 len = strlen(result) + 1;
91 if (ep - bp < len) {

--- 168 unchanged lines hidden ---
84 *cp = '\0';
85
86 cp = strpbrk(result, " \t");
87 *cp++ = '\0';
88 bp = ned->netbuf;
89 ep = ned->netbuf + sizeof ned->netbuf;
90 len = strlen(result) + 1;
91 if (ep - bp < len) {

--- 168 unchanged lines hidden ---