svn commit: r211116 - head/tools/regression/fstest
Pawel Jakub Dawidek
pjd at FreeBSD.org
Mon Aug 9 20:16:53 UTC 2010
Author: pjd
Date: Mon Aug 9 20:16:52 2010
New Revision: 211116
URL: http://svn.freebsd.org/changeset/base/211116
Log:
Linux has no strlcpy().
Modified:
head/tools/regression/fstest/fstest.c
Modified: head/tools/regression/fstest/fstest.c
==============================================================================
--- head/tools/regression/fstest/fstest.c Mon Aug 9 19:53:24 2010 (r211115)
+++ head/tools/regression/fstest/fstest.c Mon Aug 9 20:16:52 2010 (r211116)
@@ -541,7 +541,8 @@ call_syscall(struct syscall_desc *scall,
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,
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;
More information about the svn-src-all
mailing list