about summary refs log tree commit diff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/examples/mkfsock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/manual/examples/mkfsock.c b/manual/examples/mkfsock.c
index affeba66be..1ecabb95cf 100644
--- a/manual/examples/mkfsock.c
+++ b/manual/examples/mkfsock.c
@@ -23,6 +23,7 @@ make_named_socket (const char *filename)
   /* Bind a name to the socket.  */
   name.sun_family = AF_LOCAL;
   strncpy (name.sun_path, filename, sizeof (name.sun_path));
+  name.sun_path[sizeof (name.sun_path) - 1] = '\0';
 
   /* The size of the address is
      the offset of the start of the filename,