diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2005-12-03 05:11:07 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2005-12-03 05:11:07 +0000 |
commit | 51d3b3edd07d501f9272f937cb63bea7e0d6fae1 (patch) | |
tree | 7a1ff1581632aadb1700b0e34fd2b550177ff557 /lib/libc/gen/__xuname.c | |
parent | b7c797730221439cd9b743de90a62191a1955ac4 (diff) | |
download | FreeBSD-src-51d3b3edd07d501f9272f937cb63bea7e0d6fae1.zip FreeBSD-src-51d3b3edd07d501f9272f937cb63bea7e0d6fae1.tar.gz |
Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION
Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)
Diffstat (limited to 'lib/libc/gen/__xuname.c')
-rw-r--r-- | lib/libc/gen/__xuname.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c index e5139b7..ee96ad6 100644 --- a/lib/libc/gen/__xuname.c +++ b/lib/libc/gen/__xuname.c @@ -74,7 +74,7 @@ __xuname(int namesize, void *namebuf) } name->sysname[sizeof(name->sysname) - 1] = '\0'; if ((p = getenv("UNAME_s"))) - strncpy(name->sysname, p, sizeof(name->sysname)); + strlcpy(name->sysname, p, sizeof(name->sysname)); mib[0] = CTL_KERN; mib[1] = KERN_HOSTNAME; @@ -100,7 +100,7 @@ __xuname(int namesize, void *namebuf) } name->release[sizeof(name->release) - 1] = '\0'; if ((p = getenv("UNAME_r"))) - strncpy(name->release, p, sizeof(name->release)); + strlcpy(name->release, p, sizeof(name->release)); /* The version may have newlines in it, turn them into spaces. */ mib[0] = CTL_KERN; @@ -123,7 +123,7 @@ __xuname(int namesize, void *namebuf) } } if ((p = getenv("UNAME_v"))) - strncpy(name->version, p, sizeof(name->version)); + strlcpy(name->version, p, sizeof(name->version)); mib[0] = CTL_HW; mib[1] = HW_MACHINE; @@ -137,6 +137,6 @@ __xuname(int namesize, void *namebuf) } name->machine[sizeof(name->machine) - 1] = '\0'; if ((p = getenv("UNAME_m"))) - strncpy(name->machine, p, sizeof(name->machine)); + strlcpy(name->machine, p, sizeof(name->machine)); return (rval); } |