07.06.2016, 11:25
(07.06.2016, 06:17)admin Wrote: Erwin, that check is incorrect
256 * 256 * 256 * 256 = 0x100000000 (4294967296)
Maximum value for unsigned 32-bit integer is 0xFFFFFFFF (4294967295)
Code:if event.getvalue() then value = grp.getvalue('1/1/1') + 1 -- overflow check if value > 0xFFFFFFFF then value = 0 end grp.update('1/1/1', value) end
Hi Admin,
Yes you are right, i add the +1 after validation, so it will never be that value
Sorry (;
BR,
Erwin