Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Oct 1995 11:18:55 -0600
From:      Nate Williams <nate@rocky.sri.MT.net>
To:        kedron@tribe.com (Kedron Wolcott)
Cc:        bugs@freebsd.org
Subject:   Re: 2.0.5 mktemp bug.
Message-ID:  <199510271718.LAA04338@rocky.sri.MT.net>
In-Reply-To: <199510271707.KAA08844@tribe.com>
References:  <199510271707.KAA08844@tribe.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Sorry about not filing this report with the send-pr command, but I'm just
> learning Unix now and I don't have the mail program up.
> 
> However, I do think this is a bug.  The program

> 
> ---------
> #include <unistd.h>
> 
> void
> main ( void )
> {
>   mktemp( "/tmp/tmp.XXXX" );
> }
> ---------
> 
> gives me a bus-error core dump.

As well it should.  This is the exepected behavior.  From the manpage.

    The mktemp() function takes the given file name template and overwrites a
    portion of it to create a file name.

The routine is attempting to write to a constant string, which it can't
so it cores.  You need to give a writeable memory location to mktemp().


Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510271718.LAA04338>