Deleted Added
full compact
timelocal.c (28021) timelocal.c (39327)
1/*-
2 * Copyright (c) 1997 FreeBSD Inc.
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
1/*-
2 * Copyright (c) 1997 FreeBSD Inc.
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $Id$
26 * $Id: timelocal.c,v 1.1 1997/08/09 15:43:57 joerg Exp $
27 */
28
29#include <sys/types.h>
30#include <sys/stat.h>
31#include <sys/syslimits.h>
32#include <fcntl.h>
33#include <locale.h>
34#include <stdlib.h>

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

141 goto no_locale;
142 if (fstat(fd, &st) != 0)
143 goto bad_locale;
144 if (st.st_size <= 0)
145 goto bad_locale;
146 bufsize = namesize + st.st_size;
147 locale_buf = NULL;
148 lbuf = (lbuf == NULL || lbuf == locale_buf_C) ?
27 */
28
29#include <sys/types.h>
30#include <sys/stat.h>
31#include <sys/syslimits.h>
32#include <fcntl.h>
33#include <locale.h>
34#include <stdlib.h>

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

141 goto no_locale;
142 if (fstat(fd, &st) != 0)
143 goto bad_locale;
144 if (st.st_size <= 0)
145 goto bad_locale;
146 bufsize = namesize + st.st_size;
147 locale_buf = NULL;
148 lbuf = (lbuf == NULL || lbuf == locale_buf_C) ?
149 malloc(bufsize) : realloc(lbuf, bufsize);
149 malloc(bufsize) : reallocf(lbuf, bufsize);
150 if (lbuf == NULL)
151 goto bad_locale;
152 (void) strcpy(lbuf, name);
153 p = lbuf + namesize;
154 plim = p + st.st_size;
155 if (read(fd, p, (size_t) st.st_size) != st.st_size)
156 goto bad_lbuf;
157 if (close(fd) != 0)

--- 40 unchanged lines hidden ---
150 if (lbuf == NULL)
151 goto bad_locale;
152 (void) strcpy(lbuf, name);
153 p = lbuf + namesize;
154 plim = p + st.st_size;
155 if (read(fd, p, (size_t) st.st_size) != st.st_size)
156 goto bad_lbuf;
157 if (close(fd) != 0)

--- 40 unchanged lines hidden ---