Compliance with what? Is there a standard that specifies ptsname_r? We don't use implicit boolean coercions, we use (buf != NULL). But unless there is a standard requiring that you diagnose a null pointer argument somehow, then it's actually better that it just crash.
Thanks, Roland