handle null arguments to legacy bsd err.h functions