Hacker News
points by throwaway2037 2 days ago | 0 comments

    > You can't check errno to see if there was a failure because, as the man page says, the value of errno is unspecified when crypt succeeds.
You can set errno to zero before the call. If the value is non-zero after the call, that is a good heuristic for failure.
[–] zbentley 2 days ago
...unless crypt() is one of the many, many functions which themselves internally call functions that set errno. In which case you can't be sure.
Hacker News