Deleted Added
full compact
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

38static char sccsid[] = "@(#)tmpnam.c 8.3 (Berkeley) 3/28/94";
39#endif /* LIBC_SCCS and not lint */
40
41#include <sys/types.h>
42
43#include <stdio.h>
44#include <unistd.h>
45
46char *
47tmpnam(s)
48 char *s;
49{
50 static u_long tmpcount;
51 static char buf[L_tmpnam];
52
53 if (s == NULL)
54 s = buf;
55 (void)snprintf(s, L_tmpnam, "%stmp.%lu.XXXXXX", P_tmpdir, tmpcount);
56 ++tmpcount;
57 return (mktemp(s));
58}