Commit 4c072d01 authored by Nikias Bassen's avatar Nikias Bassen

bplist: Improve integer node parsing, remove unnecessary memcpy()

parent 6a44dfb7
......@@ -214,13 +214,9 @@ static plist_t parse_uint_node(const char **bnode, uint8_t size)
case sizeof(uint16_t):
case sizeof(uint32_t):
case sizeof(uint64_t):
memcpy(&data->intval, *bnode, size);
data->intval = UINT_TO_HOST(&data->intval, size);
data->length = sizeof(uint64_t);
break;
case 16:
memcpy(&data->intval, (*bnode)+8, sizeof(uint64_t));
data->intval = UINT_TO_HOST(&data->intval, sizeof(uint64_t));
data->length = size;
break;
default:
......@@ -228,6 +224,8 @@ static plist_t parse_uint_node(const char **bnode, uint8_t size)
return NULL;
};
data->intval = UINT_TO_HOST(*bnode, size);
(*bnode) += size;
data->type = PLIST_UINT;
......
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