diff options
author | Andrei Homescu <ah@immunant.com> | 2021-04-15 02:49:12 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-15 02:49:12 +0000 |
commit | 49c1162f4fb9f7eeb34aedff3702774218f6c2e1 (patch) | |
tree | 31e098ee8aef09d4327027589b0cdef6f631e004 | |
parent | 4152281d79402e7b3be7ecf813a79a9d5435c6c0 (diff) | |
parent | 02e6c572b99a3ba2e37db4e21ba64712570b1de1 (diff) | |
download | libcppbor-49c1162f4fb9f7eeb34aedff3702774218f6c2e1.tar.gz |
Fix integer cast in handleNint am: a7ca25a181 am: 33060560da am: 02e6c572b9
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1663840
Change-Id: I10b3f39467e855be7fcdf0be9a1006962a2580bf
-rw-r--r-- | src/cppbor_parse.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cppbor_parse.cpp b/src/cppbor_parse.cpp index ab01ee7..f5e8fcf 100644 --- a/src/cppbor_parse.cpp +++ b/src/cppbor_parse.cpp @@ -71,7 +71,7 @@ std::tuple<const uint8_t*, ParseClient*> handleNint(uint64_t value, const uint8_ parseClient->error(hdrBegin, "NINT values that don't fit in int64_t are not supported."); return {hdrBegin, nullptr /* end parsing */}; } - std::unique_ptr<Item> item = std::make_unique<Nint>(-1 - static_cast<uint64_t>(value)); + std::unique_ptr<Item> item = std::make_unique<Nint>(-1 - static_cast<int64_t>(value)); return {hdrEnd, parseClient->item(item, hdrBegin, hdrEnd /* valueBegin */, hdrEnd /* itemEnd */)}; } |