Skip to content

Commit 64491d8

Browse files
authored
Merge pull request #338 from whitehse/master
In cbor2cjson.c example, add missing cbor_move to cbor_array_get call
2 parents fd0f456 + e4e7c3d commit 64491d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/cbor2cjson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cJSON* cbor_to_cjson(cbor_item_t* item) {
4141
case CBOR_TYPE_ARRAY: {
4242
cJSON* result = cJSON_CreateArray();
4343
for (size_t i = 0; i < cbor_array_size(item); i++) {
44-
cJSON_AddItemToArray(result, cbor_to_cjson(cbor_array_get(item, i)));
44+
cJSON_AddItemToArray(result, cbor_to_cjson(cbor_move(cbor_array_get(item, i))));
4545
}
4646
return result;
4747
}

0 commit comments

Comments
 (0)