This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
basic_streambuf patch
- To: "libstdc++ AT sourceware.cygnus dot com" <libstdc++ AT sourceware.cygnus dot com>
- Subject: basic_streambuf patch
- From: Vadim Egorov <egorovv AT 1c.ru>
- Date: Wed, 15 Sep 1999 18:28:48 +0400
Hello,
Occasionally I put an empty std::string into std::cout and got core
dumped.
Here a simple patch for this case.
Regards,
Vadim
1999-09-15 Vadim Egorov <egorovv@1c.ru>
* bits/streambuf.tcc (basic_streambuf::xsputn): add check for zero
count
Index: streambuf.tcc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/streambuf.tcc,v
retrieving revision 1.14
diff -c -r1.14 streambuf.tcc
*** streambuf.tcc 1999/08/17 07:31:27 1.14
--- streambuf.tcc 1999/09/15 14:21:52
***************
*** 155,160 ****
--- 155,163 ----
streamsize __retval = 0;
streamsize __already = 0;
+ if (!__n)
+ return 0;
+
if (__testout)
{
if (__testinit)
--
*********************************************
Vadim Egorov, 1C * Вадим Егоров,1C
egorovv@1c.ru * egorovv@1c.ru
*********************************************