Commit c5670ac6 by Ulrich Drepper

(operator>>): Cast new character to char before adding to string.

(getline): Likewise.

From-SVN: r23786
parent 9855b854
...@@ -39,7 +39,7 @@ operator delete (void * ptr) ...@@ -39,7 +39,7 @@ operator delete (void * ptr)
{ {
Allocator::deallocate(ptr, sizeof(Rep) + Allocator::deallocate(ptr, sizeof(Rep) +
reinterpret_cast<Rep *>(ptr)->res * reinterpret_cast<Rep *>(ptr)->res *
sizeof (charT)); sizeof (charT));
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
...@@ -450,7 +450,7 @@ operator>> (istream &is, basic_string <charT, traits, Allocator> &s) ...@@ -450,7 +450,7 @@ operator>> (istream &is, basic_string <charT, traits, Allocator> &s)
sb->sungetc (); sb->sungetc ();
break; break;
} }
s += ch; s += static_cast<char> (ch);
if (--w == 1) if (--w == 1)
break; break;
} }
...@@ -496,7 +496,7 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim) ...@@ -496,7 +496,7 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
if (ch == delim) if (ch == delim)
break; break;
s += ch; s += static_cast<char> (ch);
if (s.length () == s.npos - 1) if (s.length () == s.npos - 1)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment