diff options
author | peter <peter@FreeBSD.org> | 2001-01-27 06:01:48 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-01-27 06:01:48 +0000 |
commit | cf3baa5309b90aa6d0de30bd49af8d9a54b42595 (patch) | |
tree | c2b17bb6a774f79a7d57845e0a4f26c052134d8f /sys | |
parent | 7e605d2e0fb28b05c76c9060f54e726940cc5994 (diff) | |
download | FreeBSD-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.h | 6 |
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; \ } /* |