Deleted Added
full compact
randomize_fd.c (181615) randomize_fd.c (209157)
1/*
2 * Copyright (C) 2003 Sean Chittenden <seanc@FreeBSD.org>
3 * 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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (C) 2003 Sean Chittenden <seanc@FreeBSD.org>
3 * 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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/games/random/randomize_fd.c 181615 2008-08-11 23:24:42Z ache $");
28__FBSDID("$FreeBSD: head/games/random/randomize_fd.c 209157 2010-06-14 13:03:25Z uqs $");
29
30#include <sys/types.h>
31#include <sys/param.h>
32
33#include <ctype.h>
34#include <err.h>
35#include <errno.h>
36#include <stdlib.h>

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

99 u_long i, j, numnode, selected;
100 struct rand_node *n, *prev;
101 int bufleft, eof, fndstr, ret;
102 size_t bufc, buflen;
103 ssize_t len;
104
105 rand_root = rand_tail = NULL;
106 bufc = i = 0;
29
30#include <sys/types.h>
31#include <sys/param.h>
32
33#include <ctype.h>
34#include <err.h>
35#include <errno.h>
36#include <stdlib.h>

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

99 u_long i, j, numnode, selected;
100 struct rand_node *n, *prev;
101 int bufleft, eof, fndstr, ret;
102 size_t bufc, buflen;
103 ssize_t len;
104
105 rand_root = rand_tail = NULL;
106 bufc = i = 0;
107 bufleft = eof = fndstr = numnode = ret = 0;
107 bufleft = eof = fndstr = numnode = 0;
108
109 if (type == RANDOM_TYPE_UNSET)
110 type = RANDOM_TYPE_LINES;
111
112 buflen = sizeof(u_char) * MAXBSIZE;
113 buf = (u_char *)malloc(buflen);
114 if (buf == NULL)
115 err(1, "malloc");

--- 131 unchanged lines hidden ---
108
109 if (type == RANDOM_TYPE_UNSET)
110 type = RANDOM_TYPE_LINES;
111
112 buflen = sizeof(u_char) * MAXBSIZE;
113 buf = (u_char *)malloc(buflen);
114 if (buf == NULL)
115 err(1, "malloc");

--- 131 unchanged lines hidden ---