* Copyright (c) 1988 Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)tempnam.c 5.2 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
if (!(name
= malloc(MAXPATHLEN
)))
if (f
= getenv("TMPDIR")) {
(void)snprintf(name
, MAXPATHLEN
, "%s%s%sXXXXXX", f
,
*(f
+ strlen(f
) - 1) == '/'? "": "/", pfx
);
(void)snprintf(name
, MAXPATHLEN
, "%s%s%sXXXXXX", f
,
*(f
+ strlen(f
) - 1) == '/'? "": "/", pfx
);
(void)snprintf(name
, MAXPATHLEN
, "%s%sXXXXXX", f
, pfx
);
(void)snprintf(name
, MAXPATHLEN
, "%s%sXXXXXX", f
, pfx
);