fstream.tcc (_M_convert_to_external): Set __elen to zero if codecvt::out eventually...
authorPaolo Carlini <pcarlini@unitus.it>
Fri, 7 Mar 2003 22:20:18 +0000 (23:20 +0100)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 7 Mar 2003 22:20:18 +0000 (22:20 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fstream.tcc

index 5298239337aa420d1776c77dad23b5a9f5fce84d..6359e773a9cc334d53d3244f0ae0eb0dcf8e3b61 100644 (file)
@@ -1,3 +1,8 @@
+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
index 484ed7be057f8efafd20e9479826485119291308..568c08c47292f2becc48baede6014b48940430b8 100644 (file)
@@ -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);