Format session socket name in place into the sockaddr_un

This commit is contained in:
Maxime Coste 2015-08-22 11:27:04 +01:00
parent 564ab7d942
commit 47ab4038ec

View File

@ -432,8 +432,7 @@ static sockaddr_un session_addr(StringView session)
{ {
sockaddr_un addr; sockaddr_un addr;
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, format("/tmp/kak-{}", session).c_str(), format_to(addr.sun_path, "/tmp/kak-{}", session);
sizeof(addr.sun_path) - 1);
return addr; return addr;
} }