Minor: should initialize errno to 0 before calling strtol.