Fix undefined behavior in UnsignedIntegerCalc (again)

This commit is contained in:
Vinnie Falco
2013-09-17 17:32:04 -07:00
parent ddb8268d5f
commit ee5c600e29

View File

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