diff options
author | pjd <pjd@FreeBSD.org> | 2010-08-09 20:16:52 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-08-09 20:16:52 +0000 |
commit | db2419320fc362321d6b0801b2ccd48aaaf23857 (patch) | |
tree | 7eb79146fc494dbceb5b85b846d81a1f0e74f176 /tools | |
parent | 7ff79c51bb96fa202ddafe756a72d304ef8e6c1f (diff) | |
download | FreeBSD-src-db2419320fc362321d6b0801b2ccd48aaaf23857.zip FreeBSD-src-db2419320fc362321d6b0801b2ccd48aaaf23857.tar.gz |
Linux has no strlcpy().
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/fstest/fstest.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/regression/fstest/fstest.c b/tools/regression/fstest/fstest.c index 7c659a6..0d0b22e 100644 --- a/tools/regression/fstest/fstest.c +++ b/tools/regression/fstest/fstest.c @@ -541,7 +541,8 @@ call_syscall(struct syscall_desc *scall, char *argv[]) struct sockaddr_un sunx; sunx.sun_family = AF_UNIX; - strlcpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path)); + strncpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; rval = socket(AF_UNIX, SOCK_STREAM, 0); if (rval < 0) break; @@ -553,7 +554,8 @@ call_syscall(struct syscall_desc *scall, char *argv[]) struct sockaddr_un sunx; sunx.sun_family = AF_UNIX; - strlcpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path)); + strncpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; rval = socket(AF_UNIX, SOCK_STREAM, 0); if (rval < 0) break; |