unsigned int is always greater than or equal to zero.
Change-Id: I2aa83c4a224e5bbaf22882ccb131161850dcee57
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18879
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
OIC_LOG(ERROR, TAG, "too large size");
// set the block size to be smaller than COAP_MAX_PDU_SIZE
- for (unsigned int size = CA_DEFAULT_BLOCK_SIZE; size >= 0; size--)
+ for (unsigned int size = CA_DEFAULT_BLOCK_SIZE; ; size--)
{
if (COAP_MAX_PDU_SIZE >= (size_t)BLOCK_SIZE(size) + optionLen)
{
currData->block1.szx = size;
break;
}
+ if (0 == size)
+ {
+ break;
+ }
}
return CA_BLOCK_TOO_LARGE;
}