The previous implementation of strtoul(l) is flawed. The range check assumed that when overflow happens, the truncated value is smaller than the original value. As a counter example, passing "10000000000" to strtol will not trigger ERANGE, but return a truncated value. This patch adds more accurate range checks. Change-Id: I239e034e390b4974157ed6efa17110f2e74904cf Signed-off-by: Peter Bee <bijunda1@xiaomi.com>