sl@0: /* sl@0: * Copyright (c) 1988 Regents of the University of California. sl@0: * All rights reserved. sl@0: * sl@0: * Redistribution and use in source and binary forms are permitted sl@0: * provided that this notice is preserved and that due credit is given sl@0: * to the University of California at Berkeley. The name of the University sl@0: * may not be used to endorse or promote products derived from this sl@0: * software without specific written prior permission. This software sl@0: * is provided ``as is'' without express or implied warranty. sl@0: * sl@0: * RCS: @(#) $Id: tmpnam.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /* sl@0: * Use /tmp instead of /usr/tmp, because L_tmpname is only 14 chars sl@0: * on some machines (like NeXT machines) and /usr/tmp will cause sl@0: * buffer overflows. sl@0: */ sl@0: sl@0: #ifdef P_tmpdir sl@0: # undef P_tmpdir sl@0: #endif sl@0: #define P_tmpdir "/tmp" sl@0: sl@0: char * sl@0: tmpnam(s) sl@0: char *s; sl@0: { sl@0: static char name[50]; sl@0: char *mktemp(); sl@0: sl@0: if (!s) sl@0: s = name; sl@0: (void)sprintf(s, "%s/XXXXXX", P_tmpdir); sl@0: return(mktemp(s)); sl@0: }