This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: mkstemp bug
- From: Sam Steingold <sds at gnu dot org>
- To: cygwin at cygwin dot com, "Tony Richardson" <richardson at evansville dot edu>
- Date: Wed, 27 Apr 2005 15:52:21 -0400
- Subject: Re: mkstemp bug
- References: <usm1cb0aa.fsf@gnu.org> <d4oilk$onv$1@sea.gmane.org>
- Reply-to: sds at gnu dot org
> * Tony Richardson <evpuneqfba@rinafivyyr.rqh> [2005-04-27 12:41:20 -0500]:
>
> I'm surprised your example doesn't segfault. My Linux man page says
> explicitly that the template should not be a string constant but must
> be a character array, i.e. use
>
> char t1[] = "/tmp/clisp-x-io-XXXXXX";
> char t2[] = "/tmp/clisp-x-io-XXXXXX";
> char t3[] = "/tmp/clisp-x-io-XXXXXX";
>
> mkstemp(t1);
> mkstemp(t2);
> mkstemp(t3);
>
> instead.
that's what I did. I was sloppy in my posting.
the strings passed to mkstemp where explicitly allocated with alloca and
properly filled.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://ffii.org/> <http://www.dhimmi.com/> <http://www.mideasttruth.com/>
<http://www.honestreporting.com> <http://www.memri.org/>
The world is coming to an end. Please log off.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/