Commit de259a21 authored by Todd Malsbary's avatar Todd Malsbary Committed by Uze Choi

[IOT-2218] Encode empty arrays as 80 ([]), not 80 F6 ([null]).

Bug: https://jira.iotivity.org/browse/IOT-2218
Change-Id: Iaa0086ac69d02d2d36169efb3f304c71cefc7425
Signed-off-by: default avatarTodd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19689Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarPhil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
parent 37ed9e2f
......@@ -777,14 +777,6 @@ static int64_t OCConvertArray(CborEncoder *parent, const OCRepPayloadValueArray
CborEncoder array;
err |= cbor_encoder_create_array(parent, &array, valArray->dimensions[0]);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed creating rep array");
// empty array
if (valArray->dimensions[0] == 0)
{
err |= OCConvertArrayItem(&array, valArray, 0);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed adding rep array value");
}
else
{
for (size_t i = 0; i < valArray->dimensions[0]; ++i)
{
if (0 != valArray->dimensions[1])
......@@ -827,7 +819,6 @@ static int64_t OCConvertArray(CborEncoder *parent, const OCRepPayloadValueArray
VERIFY_CBOR_SUCCESS(TAG, err, "Failed adding rep array value");
}
}
}
err |= cbor_encoder_close_container(parent, &array);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed closing rep array");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment