Use strtol instead of strtonum.