This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

basic_streambuf patch


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
*********************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]