Deleted Added
full compact
tftp-utils.c (213099) tftp-utils.c (215034)
1/*
2 * Copyright (C) 2008 Edwin Groothuis. All rights reserved.
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) 2008 Edwin Groothuis. All rights reserved.
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/libexec/tftpd/tftp-utils.c 213099 2010-09-24 10:40:17Z marius $");
27__FBSDID("$FreeBSD: head/libexec/tftpd/tftp-utils.c 215034 2010-11-09 10:59:09Z brucec $");
28
29#include <sys/socket.h>
30#include <sys/stat.h>
31
32#include <netinet/in.h>
33#include <arpa/tftp.h>
34
35#include <stdarg.h>

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

95 port = sin6->sin6_port;
96 memset(sin4, 0, sizeof(struct sockaddr_in));
97 sin4->sin_addr.s_addr = addr;
98 sin4->sin_port = port;
99 sin4->sin_family = AF_INET;
100 sin4->sin_len = sizeof(struct sockaddr_in);
101}
102
28
29#include <sys/socket.h>
30#include <sys/stat.h>
31
32#include <netinet/in.h>
33#include <arpa/tftp.h>
34
35#include <stdarg.h>

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

95 port = sin6->sin6_port;
96 memset(sin4, 0, sizeof(struct sockaddr_in));
97 sin4->sin_addr.s_addr = addr;
98 sin4->sin_port = port;
99 sin4->sin_family = AF_INET;
100 sin4->sin_len = sizeof(struct sockaddr_in);
101}
102
103/* Get a field from a \0 seperated string */
103/* Get a field from a \0 separated string */
104ssize_t
105get_field(int peer, char *buffer, ssize_t size)
106{
107 char *cp = buffer;
108
109 while (cp < buffer + size) {
110 if (*cp == '\0') break;
111 cp++;

--- 208 unchanged lines hidden ---
104ssize_t
105get_field(int peer, char *buffer, ssize_t size)
106{
107 char *cp = buffer;
108
109 while (cp < buffer + size) {
110 if (*cp == '\0') break;
111 cp++;

--- 208 unchanged lines hidden ---