From 4c072d015193af74719d07897c0a0b4396b4a866 Mon Sep 17 00:00:00 2001
From: Nikias Bassen
Date: Wed, 25 Jan 2017 02:41:38 +0100
Subject: bplist: Improve integer node parsing, remove unnecessary memcpy()

---
 src/bplist.c | 6 ++----
 1 file 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;
 
-- 
cgit v1.1-32-gdbae