Wrap all snprintf usage to simplify error handling