/* Example of Local-Namespace Sockets
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+ along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
#include <stddef.h>
/* The size of the address is
the offset of the start of the filename,
- plus its length,
- plus one for the terminating null byte.
+ plus its length (not including the terminating null byte).
Alternatively you can just do:
size = SUN_LEN (&name);
*/
size = (offsetof (struct sockaddr_un, sun_path)
- + strlen (name.sun_path) + 1);
+ + strlen (name.sun_path));
if (bind (sock, (struct sockaddr *) &name, size) < 0)
{