Skip to content

Commit

Permalink
Fix formatting and CBMC proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
AniruddhaKanhere committed Sep 21, 2022
1 parent 0737ab4 commit f792ab0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions source/core_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,6 @@ static int32_t sendMessageVector( MQTTContext_t * pContext,
uint32_t timeoutTime;
uint32_t bytesToSend = 0U;
int32_t bytesSentOrError = 0;
uint64_t temp = 0;
TransportOutVector_t * pIoVectIterator;
size_t vectorsToBeSent = ioVecCount;

Expand All @@ -751,7 +750,6 @@ static int32_t sendMessageVector( MQTTContext_t * pContext,
/* Count the total number of bytes to be sent as outlined in the vector. */
for( pIoVectIterator = pIoVec; pIoVectIterator <= &( pIoVec[ ioVecCount - 1U ] ); pIoVectIterator++ )
{
temp += pIoVectIterator->iov_len;
bytesToSend += ( uint32_t ) pIoVectIterator->iov_len;
}

Expand Down Expand Up @@ -785,9 +783,7 @@ static int32_t sendMessageVector( MQTTContext_t * pContext,
{
bytesSentOrError = sendResult;

/* We do not need to break here as this condition is checked in
* the loop. The following code will not execute as bytesSentThisVector
* is not updated and is still 0. */
break;
}

while( ( pIoVectIterator <= &( pIoVec[ ioVecCount - 1U ] ) ) &&
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_Disconnect/MQTT_Disconnect_harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void harness()

pContext = allocateMqttContext( NULL );
__CPROVER_assume( isValidMqttContext( pContext ) );
__CPROVER_assume( pContext != NULL );
__CPROVER_assume( pContext != NULL );
__CPROVER_assume( pContext->networkBuffer.pBuffer != NULL );

MQTT_Disconnect( pContext );
Expand Down

0 comments on commit f792ab0

Please sign in to comment.