version 1.161, 2003/01/07 14:32:47
|
version 1.162, 2003/01/07 15:28:58
|
Line 2426 char *GetTempName (const char *dir, cons
|
Line 2426 char *GetTempName (const char *dir, cons
|
{ |
{ |
#ifdef JOSE |
#ifdef JOSE |
|
|
static char tmpbufmem[FILENAME_MAX]; |
static char tmpbufmem[PATH_MAX + 1]; |
int len; |
int len; |
int i; |
int i; |
|
|
if (!dir || *dir == EOS || !TtaDirExists (dir)) |
if (!dir || *dir == EOS || !TtaDirExists (dir)) |
return NULL; |
return NULL; |
|
|
/* make sure that the name is no bigger than FILENAME_MAX */ |
/* make sure that the name is no bigger than PATH_MAX + the 6 tempname chars we |
|
will add */ |
|
|
len = strlen (dir); |
len = strlen (dir); |
if (len + L_tmpnam > FILENAME_MAX) |
if (len + 6 > PATH_MAX) |
return NULL; |
return NULL; |
|
|
/* copy the dir name, and add a DIR_SEP if it's missing */ |
/* copy the dir name, and add a DIR_SEP if it's missing */ |