diff options
author | Nikias Bassen | 2017-01-25 02:41:38 +0100 |
---|---|---|
committer | Nikias Bassen | 2017-01-25 02:41:38 +0100 |
commit | 4c072d015193af74719d07897c0a0b4396b4a866 (patch) | |
tree | 7a59420d5e03e5da7b07912dd4e0bef2bf308ea8 /src/bplist.c | |
parent | 6a44dfb72f1cb5c82c10feed95ff9428eec49d0a (diff) | |
download | libplist-4c072d015193af74719d07897c0a0b4396b4a866.tar.gz libplist-4c072d015193af74719d07897c0a0b4396b4a866.tar.bz2 |
bplist: Improve integer node parsing, remove unnecessary memcpy()
Diffstat (limited to 'src/bplist.c')
-rw-r--r-- | src/bplist.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bplist.c b/src/bplist.c index 7cc8a03..ad8e753 100644 --- a/src/bplist.c +++ b/src/bplist.c @@ -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; |