Set errno = 0 before checking for int-overflow