This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] use mkstemp instead of mktemp.
- From: Muthukumar Ratty <muthu at iqmail dot net>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 1 Jul 2003 19:10:09 -0700 (PDT)
- Subject: Re: [patch] use mkstemp instead of mktemp.
oops.... otherway around :)
--- binutils-cvs/bucomm.c Tue Jul 1 18:53:53 2003
+++ binutils/bucomm.c Tue Jul 1 18:54:20 2003
@@ -438,14 +438,14 @@ make_tempname (filename)
#endif
strcat (tmpname, "/");
strcat (tmpname, template);
- mktemp (tmpname);
+ mkstemp (tmpname);
*slash = c;
}
else
{
tmpname = xmalloc (sizeof (template));
strcpy (tmpname, template);
- mktemp (tmpname);
+ mkstemp (tmpname);
}
return tmpname;
}
On Tue, 1 Jul 2003, Muthukumar Ratty wrote:
>
> Hi All,
> I was compiling the binutils from cvs and got the following warning ...
>
> /backup/bleed/BINUTILS/src/binutils/bucomm.c:441: the use of `mktemp' is
> dangerous, better use `mkstemp'
>
> Let me know if the following is ok...
> thanks,
> Muthu
>
> --- binutils/bucomm.c Tue Jul 1 18:54:20 2003
> +++ binutils-cvs/bucomm.c Tue Jul 1 18:53:53 2003
> @@ -438,14 +438,14 @@ make_tempname (filename)
> #endif
> strcat (tmpname, "/");
> strcat (tmpname, template);
> - mkstemp (tmpname);
> + mktemp (tmpname);
> *slash = c;
> }
> else
> {
> tmpname = xmalloc (sizeof (template));
> strcpy (tmpname, template);
> - mkstemp (tmpname);
> + mktemp (tmpname);
> }
> return tmpname;
> }
>
>