summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-27 06:01:48 +0000
committerpeter <peter@FreeBSD.org>2001-01-27 06:01:48 +0000
commitcf3baa5309b90aa6d0de30bd49af8d9a54b42595 (patch)
treec2b17bb6a774f79a7d57845e0a4f26c052134d8f /sys
parent7e605d2e0fb28b05c76c9060f54e726940cc5994 (diff)
downloadFreeBSD-src-cf3baa5309b90aa6d0de30bd49af8d9a54b42595.zip
FreeBSD-src-cf3baa5309b90aa6d0de30bd49af8d9a54b42595.tar.gz
Bah, as my luck would have it, I had a kernel source tree in the window
while strlcpy() existed, before it got backed out due to an extended bikeshed argument. Sigh. Back to the old version with the redundant code to terminate the string. :-(
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/kernel.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index 66a8878..47feb9d 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -273,7 +273,8 @@ static void __Tunable_ ## var (void *ignored) \
tmp = getenv((path)); \
if (tmp == NULL) \
tmp = (defval); \
- strlcpy((var), tmp, (size)); \
+ strncpy((var), tmp, (size)); \
+ (var)[(size) - 1] = 0; \
} \
SYSINIT(__Tunable_init_ ## var, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, __Tunable_ ## var , NULL);
@@ -284,7 +285,8 @@ static void __Tunable_ ## var (void *ignored) \
tmp = getenv((path)); \
if (tmp == NULL) \
tmp = (defval); \
- strlcpy((var), tmp, (size)); \
+ strncpy((var), tmp, (size)); \
+ (var)[(size) - 1] = 0; \
}
/*
OpenPOWER on IntegriCloud