The getline template function reads an extra character after encountering the delimiter (240015)
The information in this article applies to:
- The Standard C++ Library, when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q240015 SYMPTOMS
The Standard C++ Library template getline function reads an extra character after encountering the delimiter. Please refer to the sample program in the More Information section for details.
RESOLUTION
Modify the getline member function, which can be found in the following system header file string, as follows:
else if (_Tr::eq((_E)_C, _D))
{_Chg = true;
// _I.rdbuf()->snextc(); /* Remove this line and add the line below.*/
_I.rdbuf()->sbumpc();
break; }
Note Because the resolution involves modifying a system header file, extreme care should be taken to ensure that nothing else is changed in the header file. Microsoft is not responsible for any problems resulting from unwanted changes to the system header files.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This problem was corrected in Microsoft Visual C++ .NET.
| Modification Type: | Major | Last Reviewed: | 9/2/2005 |
|---|
| Keywords: | kbtshoot kbprb kbBug kbfix kbLangCPP kbNoUpdate kbSTL kbtemplate KB240015 kbAudDeveloper |
|---|
|