From owner-freebsd-current Mon Oct 21 07:07:38 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA14152 for current-outgoing; Mon, 21 Oct 1996 07:07:38 -0700 (PDT) Received: from asstdc.scgt.oz.au (root@asstdc.scgt.oz.au [202.14.234.65]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA14136 for ; Mon, 21 Oct 1996 07:07:32 -0700 (PDT) Received: (from imb@localhost) by asstdc.scgt.oz.au (8.7.6/BSD4.4) id AAA16493 Tue, 22 Oct 1996 00:06:29 +1000 (EST) From: michael butler Message-Id: <199610211406.AAA16493@asstdc.scgt.oz.au> Subject: Re: mktemp BUG? In-Reply-To: <326AD788.167EB0E7@mindspring.com> from Ron Bolin at "Oct 20, 96 09:53:12 pm" To: rlb@mindspring.com (Ron Bolin) Date: Tue, 22 Oct 1996 00:06:24 +1000 (EST) Cc: freebsd-current@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Ron Bolin writes: > Just checking my system and sanity. The mktemp(char *) function > dumps core everytime. Seems to be a problem in the C lib version. > Can anyone else duplicate this bug? > #include > char *tmp = mktemp("/tmp/cp.XXXXXX"); You have two alternatives: i) fix the problem by copying the const string into an appropriately sized buffer or .. ii) avoid the problem by compiling with '-fwritable-strings' michael