From 27366ba88c9fb7a9ade78c4eadfcc4a7879cfcbc Mon Sep 17 00:00:00 2001 From: Daniel Parker Date: Sun, 17 Dec 2023 20:28:22 -0500 Subject: [PATCH] bigint test --- include/jsoncons/bigint.hpp | 2 +- test/corelib/src/bigint_tests.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/jsoncons/bigint.hpp b/include/jsoncons/bigint.hpp index 8227d33e0c..7d0ca22481 100644 --- a/include/jsoncons/bigint.hpp +++ b/include/jsoncons/bigint.hpp @@ -877,7 +877,7 @@ class basic_bigint : protected detail::basic_bigint_base if ( old_length > length() ) { - memset( data() + length(), 0, old_length - length() ); + memset( data() + length(), 0, size_type(old_length - length())*sizeof(uint64_t) ); } reduce(); diff --git a/test/corelib/src/bigint_tests.cpp b/test/corelib/src/bigint_tests.cpp index b9c0ea2d9f..2f4906f354 100644 --- a/test/corelib/src/bigint_tests.cpp +++ b/test/corelib/src/bigint_tests.cpp @@ -365,10 +365,9 @@ TEST_CASE("bigint operations") { bigint a{0}; bigint b = bigint::from_string("1277902648419017187919156692641295109476255233737630537760832794503886212911067061184379695097643279217271150419129022856601771338794256383410400076210073482253089544155377"); - bigint expected = b; b &= a; - CHECK((expected == b)); + CHECK(a == b); } }