fix integer overflow

Signed-off-by: nixnodes <code@nixnodes.net>