diff options
author | Ulrich Drepper <drepper@cygnus.com> | 1998-11-23 09:21:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@cygnus.com> | 1998-11-23 09:21:12 +0000 |
commit | a99b87a52c28be384c97113ffd651ea69938f107 (patch) | |
tree | 7e13fa5358d5741d10e8601b8f60503f000af52e /libstdc++/std | |
parent | df3804b1ad8ce8ab8b6fa2242eb1c2d3673c6c9f (diff) |
(operator>>): Cast new character to char before adding to string.
(getline): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@23786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++/std')
-rw-r--r-- | libstdc++/std/bastring.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++/std/bastring.cc b/libstdc++/std/bastring.cc index b5f7a0dbfef..4ecef59e3df 100644 --- a/libstdc++/std/bastring.cc +++ b/libstdc++/std/bastring.cc @@ -39,7 +39,7 @@ operator delete (void * ptr) { Allocator::deallocate(ptr, sizeof(Rep) + reinterpret_cast<Rep *>(ptr)->res * - sizeof (charT)); + sizeof (charT)); } template <class charT, class traits, class Allocator> @@ -450,7 +450,7 @@ operator>> (istream &is, basic_string <charT, traits, Allocator> &s) sb->sungetc (); break; } - s += ch; + s += static_cast<char> (ch); if (--w == 1) break; } @@ -496,7 +496,7 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim) if (ch == delim) break; - s += ch; + s += static_cast<char> (ch); if (s.length () == s.npos - 1) { |