aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Homescu <ah@immunant.com>2021-04-15 00:56:27 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-04-15 00:56:27 +0000
commit33060560da60c02488b908772c2c2a096563edfb (patch)
tree31e098ee8aef09d4327027589b0cdef6f631e004
parent05f22c38411cb623128ecee51802607bc253e7a1 (diff)
parenta7ca25a181f92bc4d4db75f4994939f5cbd1d788 (diff)
downloadlibcppbor-33060560da60c02488b908772c2c2a096563edfb.tar.gz
Fix integer cast in handleNint am: a7ca25a181
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1663840 Change-Id: I8e27a73ec953c0db8a44fbff11c5dc81b26e11b0
-rw-r--r--src/cppbor_parse.cpp2
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 */)};
}