activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r952466 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
Date Mon, 07 Jun 2010 22:37:12 GMT
Author: tabish
Date: Mon Jun  7 22:37:11 2010
New Revision: 952466

URL: http://svn.apache.org/viewvc?rev=952466&view=rev
Log:
Fix the nextBytes method to return early if the vector passed is empty.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp?rev=952466&r1=952465&r2=952466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp Mon Jun  7 22:37:11
2010
@@ -48,6 +48,11 @@ bool Random::nextBoolean() {
 void Random::nextBytes( std::vector<unsigned char>& buf ) {
 
     try{
+
+        if( buf.empty() ) {
+            return;
+        }
+
         this->nextBytes( &buf[0], (int)buf.size() );
     }
     DECAF_CATCH_RETHROW( NullPointerException )



Mime
View raw message