Properly check strtol() results when paring values as integers