do not exceed max int size by 1

Change-Id: I5f2c2d086600930acdc7b4f0226681c6b3c46d7b
Merge "do not exceed max int size by 1"