This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Small bug in STL - 2.95.2
- To: anke dot koelzer at daimlerchrysler dot com
- Subject: Re: Small bug in STL - 2.95.2
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 24 Feb 2000 11:29:22 +0100
- CC: bug-gcc at gnu dot org
- References: <0015200010012745000002L052*@MHS>
> I am using gcc version 2.95.2 and had the following problem:
> In std/bastring.cc - function getline - there is no
> end-of-string appended to the string.
> Thus the string is not terminated.
Thanks for your bug report. I cannot reproduce the problem, the program
#include <iostream>
#include <string>
#include <stdio.h>
int main()
{
string x;
getline(cin,x);
printf("%s\n",x.c_str());
}
works fine for me. There is no need to add a string delimiter ('\0')
to the basic_string, as the string template keeps track of the string
length separately.
If you see something different, please make a full bug report, as
requested in
http://www.gnu.org/software/gcc/bugs.html
Thanks,
Martin