diff options
author | Paolo Carlini <pcarlini@unitus.it> | 2003-03-07 23:20:18 +0100 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2003-03-07 22:20:18 +0000 |
commit | 9a97e40ae1202ee33bd14c477652ef60fdd606ad (patch) | |
tree | 16ea0f0da923684d2157d6141b8ae278bcf86f87 | |
parent | 1deba98bd23b18dbaf4da0e42ee3d5d6c48fe758 (diff) | |
download | gcc-9a97e40ae1202ee33bd14c477652ef60fdd606ad.zip gcc-9a97e40ae1202ee33bd14c477652ef60fdd606ad.tar.gz gcc-9a97e40ae1202ee33bd14c477652ef60fdd606ad.tar.bz2 |
fstream.tcc (_M_convert_to_external): Set __elen to zero if codecvt::out eventually fails.
2003-03-07 Paolo Carlini <pcarlini@unitus.it>
* include/bits/fstream.tcc (_M_convert_to_external):
Set __elen to zero if codecvt::out eventually fails.
From-SVN: r63954
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/fstream.tcc | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5298239..6359e77 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2003-03-07 Paolo Carlini <pcarlini@unitus.it> + * include/bits/fstream.tcc (_M_convert_to_external): + Set __elen to zero if codecvt::out eventually fails. + +2003-03-07 Paolo Carlini <pcarlini@unitus.it> + PR libstdc++/9182 * include/bits/fstream.tcc (_M_really_overflow): Check for _M_convert_to_external possible failures. diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 484ed7b..568c08c 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -320,8 +320,13 @@ namespace std __iend, __buf, __buf + __blen, __bend); if (__r != codecvt_base::error) __rlen = __bend - __buf; - else - __rlen = 0; + else + { + __rlen = 0; + // Signal to the caller (_M_really_overflow) that + // codecvt::out eventually failed. + __elen = 0; + } if (__rlen) { __elen += _M_file.xsputn(__buf, __rlen); |