From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28621 invoked by alias); 28 Dec 2004 01:32:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28502 invoked from network); 28 Dec 2004 01:32:10 -0000 Received: from unknown (HELO bco-exchange.bco.roguewave.com) (12.17.213.84) by sourceware.org with SMTP; 28 Dec 2004 01:32:10 -0000 Received: from [127.0.0.1] (vpn24.bco.roguewave.com [10.70.10.24]) by bco-exchange.bco.roguewave.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id VNM4G2B0; Mon, 27 Dec 2004 18:30:40 -0700 Message-ID: <41D0B791.3040207@roguewave.com> Date: Tue, 28 Dec 2004 01:32:00 -0000 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 MIME-Version: 1.0 To: gcc-bugzilla@gcc.gnu.org CC: gcc-bugs@gcc.gnu.org Subject: Re: [Bug c++/19172] strcpy bug? or mine? References: <20041228000900.19172.rolosworld@gmail.com> <20041228010045.28582.qmail@sourceware.org> In-Reply-To: <20041228010045.28582.qmail@sourceware.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg03692.txt.bz2 List-Id: rolosworld at gmail dot com wrote: > ------- Additional Comments From rolosworld at gmail dot com 2004-12-28 01:00 ------- > (In reply to comment #1) > >>You forgot C strings are null terminated. > > > > I did this: > > word = new char( strlen(str) + 1 ); Don't you mean new char [strlen(str) + 1]? I.e., brackets, not parentheses (the latter allocates a single char and initializes it with the length of str). Martin