You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/03/20 20:08:10 UTC

svn commit: r756714 - /activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp

Author: tabish
Date: Fri Mar 20 19:08:09 2009
New Revision: 756714

URL: http://svn.apache.org/viewvc?rev=756714&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-230

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp?rev=756714&r1=756713&r2=756714&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/io/BlockingByteArrayInputStream.cpp Fri Mar 20 19:08:09 2009
@@ -125,16 +125,16 @@
 
         std::size_t ix = 0;
 
-        for( ; ix < bufferSize && !closing; ++ix, ++pos)
-        {
-            if(pos == this->buffer.end())
-            {
+        for( ; ix < bufferSize && !closing; ++ix ) {
+
+            if( pos == this->buffer.end() ) {
                 // Wait for more data to come in.
                 wait();
             }
 
-            if( !closing ){
+            if( !closing && pos != this->buffer.end() ){
                 buffer[ix + offset] = *(pos);
+                ++pos;
             }
         }