This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19172] strcpy bug? or mine?
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Dec 2004 01:34:33 -0000
- Subject: [Bug c++/19172] strcpy bug? or mine?
- References: <20041228000900.19172.rolosworld@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-28 01:34 -------
That is the bug:
word = new char( strlen(str) +1);
should be:
word = new char[ strlen(str) +1];
Otherwise you are allocating only one char.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19172