Mail Archives: djgpp/1997/10/05/11:15:07
On 1 Oct 1997, Wolfgang Glunz wrote:
> Together we found out that there might be a bug in the c-library
> function tempnam (not tmpnam !). Under all other systems I known,
> tempnam returns a pointer to newly allocated memory if the first
> parameter is 0. Under djgpp 2.01 it looks like that tempnam behaves
> the same as tmpnam which returns a pointer to a static memory which
> is overwritten after each call to tmpnam.
DJGPP's `tempnam' just calls `tmpnam' internally, so it indeed returns
a pointer to a static buffer.
However, AFAIK, `tempnam' is non-ANSI and non-POSIX, so no official
standard exists for its behavior. Would you care to tell which
``other systems'' have `tempname' which returns a pointer to malloc'ed
storage?
- Raw text -