Use strtoul instead of atoi so that overflow can be detected.
mentioned in commit 4f0a61f7
mentioned in commit 27e892f6
mentioned in commit edfd1119
mentioned in commit 73886db6