Fix undefined behavior in UnsignedIntegerCalc

This commit is contained in:
Vinnie Falco
2013-09-16 18:47:35 -07:00
parent 1ad8ff9b64
commit 207ffdec8e

View File

@@ -137,8 +137,8 @@ public:
while (lo < hi)
{
std::swap (*lo, *hi);
*lo++ = toNetworkByteOrder <UInt> (*lo);
*hi-- = toNetworkByteOrder <UInt> (*hi);
*lo = toNetworkByteOrder <UInt> (*lo); ++lo;
*hi = toNetworkByteOrder <UInt> (*hi); --hi;
}
if (lo == hi)
*lo = toNetworkByteOrder <UInt> (*lo);