Fix error introduced when merging #264. (#286)
diff --git a/stream_buffer.c b/stream_buffer.c
index 382dd08..531cd4c 100644
--- a/stream_buffer.c
+++ b/stream_buffer.c
@@ -496,7 +496,7 @@
{
const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
size_t xSpace;
- volatile size_t xOriginalTail;
+ size_t xOriginalTail;
configASSERT( pxStreamBuffer );
@@ -726,7 +726,7 @@
{
size_t xNextHead = pxStreamBuffer->xHead;
- if( xDataLengthBytes != xRequiredSpace )
+ if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )
{
/* This is a message buffer, as opposed to a stream buffer. */
@@ -735,7 +735,7 @@
/* There is enough space to write both the message length and the message
* itself into the buffer. Start by writing the length of the data, the data
* itself will be written later in this function. */
- xNextHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) &( xDataLengthBytes ), sbBYTES_TO_STORE_MESSAGE_LENGTH, xNextHead);
+ xNextHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) &( xDataLengthBytes ), sbBYTES_TO_STORE_MESSAGE_LENGTH, xNextHead );
}
else
{
@@ -883,7 +883,7 @@
/* The number of bytes available is greater than the number of bytes
* required to hold the length of the next message, so another message
* is available. */
- ( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail);
+ ( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail );
xReturn = ( size_t ) xTempReturn;
}
else
@@ -939,7 +939,7 @@
* read bytes from the buffer. */
if( xBytesAvailable > xBytesToStoreMessageLength )
{
- xReceivedLength = prvReadMessageFromBuffer( pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable);
+ xReceivedLength = prvReadMessageFromBuffer( pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable );
/* Was a task waiting for space in the buffer? */
if( xReceivedLength != ( size_t ) 0 )