Deleted Added
full compact
tempnam.c (249808) tempnam.c (249810)
1/*
2 * Copyright (c) 1988, 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

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

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1988, 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

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

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libc/stdio/tempnam.c 249808 2013-04-23 13:33:13Z emaste $");
34__FBSDID("$FreeBSD: head/lib/libc/stdio/tempnam.c 249810 2013-04-23 14:36:44Z emaste $");
35
36#include <sys/param.h>
37#include <errno.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <unistd.h>
42#include <paths.h>
43
44__warn_references(tempnam,
45 "warning: tempnam() possibly used unsafely; consider using mkstemp()");
46
47extern char *_mktemp(char *);
48
49char *
35
36#include <sys/param.h>
37#include <errno.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <unistd.h>
42#include <paths.h>
43
44__warn_references(tempnam,
45 "warning: tempnam() possibly used unsafely; consider using mkstemp()");
46
47extern char *_mktemp(char *);
48
49char *
50tempnam(dir, pfx)
51 const char *dir, *pfx;
50tempnam(const char *dir, const char *pfx)
52{
53 int sverrno;
54 char *f, *name;
55
56 if (!(name = malloc(MAXPATHLEN)))
57 return(NULL);
58
59 if (!pfx)

--- 31 unchanged lines hidden ---
51{
52 int sverrno;
53 char *f, *name;
54
55 if (!(name = malloc(MAXPATHLEN)))
56 return(NULL);
57
58 if (!pfx)

--- 31 unchanged lines hidden ---