CBOR String array is coping only the first item.
Fix OCREP_PROP_STRING for string array to copy all items by
calling cbor_value_advance.
Change-Id: I1ea80e94cf21f746188af81dd946c474d8b00ba4
Signed-off-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1990
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
arr = (char**)OICMalloc(dimTotal * sizeof(char*));
for(size_t i = 0; i < dimTotal && !err; ++i)
{
- err = err || cbor_value_dup_text_string(&insideArray, &tempStr,
- &len, NULL);
- ((char**)arr)[i] = tempStr;
+ err = err || cbor_value_dup_text_string(&insideArray, &tempStr, &len, NULL);
+ ((char**) arr)[i] = tempStr;
+ err = err || cbor_value_advance(&insideArray);
}
if(!err &&
OCRepPayloadSetStringArrayAsOwner(out, name, (char**)arr, dimensions))