aboutsummaryrefslogtreecommitdiff
path: root/manual/examples/mkfsock.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-03 02:33:57 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-03 02:33:57 +0000
commit654a7a0c299f2f5beca8745a35efd4334f361140 (patch)
treedb00461f51878d348765188ae420369d40a2cbb5 /manual/examples/mkfsock.c
parent5c1159b6a9303f5c9f93e8e048d52acc630c2a86 (diff)
downloadglibc-654a7a0c299f2f5beca8745a35efd4334f361140.zip
glibc-654a7a0c299f2f5beca8745a35efd4334f361140.tar.gz
glibc-654a7a0c299f2f5beca8745a35efd4334f361140.tar.bz2
Update.
2002-02-02 Ulrich Drepper <drepper@redhat.com> * manual/examples/mkfsock.c (make_named_socket): Make sure name is always NUL-terminated. Patch by Chris D. Sloan <cds@cs.hmc.edu>.
Diffstat (limited to 'manual/examples/mkfsock.c')
-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 affeba6..1ecabb9 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,