mail[Wesnoth-commits] r44553 - /trunk/src/ana/src/asio_listener.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by billybiset on July 22, 2010 - 20:47:
Author: billynux
Date: Thu Jul 22 20:47:33 2010
New Revision: 44553

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44553&view=rev
Log:
Fixes a compilation error due to array declaration with variable length.

Modified:
    trunk/src/ana/src/asio_listener.cpp

Modified: trunk/src/ana/src/asio_listener.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ana/src/asio_listener.cpp?rev=44553&r1=44552&r2=44553&view=diff
==============================================================================
--- trunk/src/ana/src/asio_listener.cpp (original)
+++ trunk/src/ana/src/asio_listener.cpp Thu Jul 22 20:47:33 2010
@@ -205,16 +205,16 @@
 {
     tcp::socket& sock = socket();
 
-    char buf[ size ];
+    std::vector<char> buf(size);
 
     size_t received;
 
-    received = sock.receive( boost::asio::buffer( buf, size ) );
+    received = sock.receive( boost::asio::buffer( &buf[0], size ) );
 
     if ( received != size )
         throw std::runtime_error("Read a different amount of bytes than what 
was expected.");
 
-    bis.str( std::string( buf, size ) );
+    bis.str( std::string( &buf[0], size ) );
 }
 
 




Related Messages


Powered by MHonArc, Updated Thu Jul 22 21:00:13 2010