- if (sa_len >= offsetof(struct sockaddr_un, sun_path)) {
- snprintf(name, sizeof name, "unix:%.*s",
- (int) (sa_len - offsetof(struct sockaddr_un, sun_path)),
- sun->sun_path);
+ if (name_len > 0) {
+ snprintf(name, sizeof name, "unix:%.*s", name_len, sun->sun_path);