metadataengine/server/src/mdsclausebuffer.cpp
branchRCL_3
changeset 14 646a02f170b9
parent 0 c53acadfccc6
child 40 910a23996aa0
--- a/metadataengine/server/src/mdsclausebuffer.cpp	Fri Feb 19 23:14:48 2010 +0200
+++ b/metadataengine/server/src/mdsclausebuffer.cpp	Fri Mar 12 15:44:28 2010 +0200
@@ -62,15 +62,11 @@
 //
 void CMdsClauseBuffer::ConstructL( TInt aInitialSize )
     {
-    if ( aInitialSize < 1 )
+    if ( aInitialSize < 1 || aInitialSize > 100000 )
     	{
     	aInitialSize = 1;
     	}
     iCurrentBufSize = aInitialSize;
-    if (aInitialSize > 100000 || aInitialSize < 0)
-    	{
-    	aInitialSize = 0;
-    	}
 
     iBuffer = HBufC::NewL( iCurrentBufSize );
     }
@@ -104,11 +100,11 @@
         return EFalse;
         }
 
+    // realloc and copy
+    iBuffer = iBuffer->ReAllocL( aRequired );
+    
 	iCurrentBufSize = aRequired;
 
-    // realloc and copy
-    iBuffer = iBuffer->ReAllocL( iCurrentBufSize );
-
     return ETrue;
     }