From owner-freebsd-bugs Fri Oct 27 12:13:36 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA13613 for bugs-outgoing; Fri, 27 Oct 1995 12:13:36 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA13604 for ; Fri, 27 Oct 1995 12:13:32 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id FAA24825; Sat, 28 Oct 1995 05:12:01 +1000 Date: Sat, 28 Oct 1995 05:12:01 +1000 From: Bruce Evans Message-Id: <199510271912.FAA24825@godzilla.zeta.org.au> To: bugs@freebsd.org, kedron@tribe.com Subject: Re: 2.0.5 mktemp bug. Sender: owner-bugs@freebsd.org Precedence: bulk >However, I do think this is a bug. The program >--------- >#include >void >main ( void ) >{ > mktemp( "/tmp/tmp.XXXX" ); >} >--------- >gives me a bus-error core dump. I'm running FreeBSD release 2.0.5 #0, and >I compiled the program with GCC-2.6.3. mktemp() modifies the string passed to it, so the string must be in writable storage. String constants are read only in FreeBSD+gcc. You should copy the string constant to a suitable large non-const array, e.g., `char foo[32]'. Bruce