mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix undefined behavior in UnsignedIntegerCalc
This commit is contained in:
@@ -137,8 +137,8 @@ public:
|
|||||||
while (lo < hi)
|
while (lo < hi)
|
||||||
{
|
{
|
||||||
std::swap (*lo, *hi);
|
std::swap (*lo, *hi);
|
||||||
*lo++ = toNetworkByteOrder <UInt> (*lo);
|
*lo = toNetworkByteOrder <UInt> (*lo); ++lo;
|
||||||
*hi-- = toNetworkByteOrder <UInt> (*hi);
|
*hi = toNetworkByteOrder <UInt> (*hi); --hi;
|
||||||
}
|
}
|
||||||
if (lo == hi)
|
if (lo == hi)
|
||||||
*lo = toNetworkByteOrder <UInt> (*lo);
|
*lo = toNetworkByteOrder <UInt> (*lo);
|
||||||
|
|||||||
Reference in New Issue
Block a user