[mb-devel] Possible Client SDK code bug

Robert Kaye rob at eorbit.net
Mon Oct 23 21:26:21 UTC 2006


On Oct 21, 2006, at 4:47 AM, Andy Bridle wrote:
>
> The source for member function MBHttp::WriteToBuffer contains the  
> following
> code to calculate the new size for the dynamic buffer:
>
>     if (m_bytesInBuffer + size > m_bufferSize)
>     {
> 	  .
>         m_bufferSize += (kBufferSize < size) ? kBufferSize :  
> kBufferSize +
> size;
>         .
>     }
>
> Which, to me, looks the wrong way round, ie it should be:
>
>         m_bufferSize += (kBufferSize < size) ? kBufferSize + size :
> kBufferSize;
>
> But please feel free to make me look silly.

Did you see that the line in question is INCREASING the allocated  
buffer size? Its not calculating a total new size. The code looks OK  
to me.



--

--ruaok      Somewhere in Texas a village is *still* missing its idiot.

Robert Kaye     --     rob at eorbit.net     --    http://mayhem-chaos.net





More information about the MusicBrainz-devel mailing list