Clean up uname(2) code some more.

This commit is contained in:
mycroft 1994-03-18 18:57:13 +00:00
parent 75e174b39c
commit 1dbf6bf32e
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
revision 1.37 intentionally removed revision 1.38 intentionally removed

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* from: @(#)kern_xxx.c 7.17 (Berkeley) 4/20/91 * from: @(#)kern_xxx.c 7.17 (Berkeley) 4/20/91
* $Id: kern_xxx.c,v 1.11 1994/03/01 07:58:28 glass Exp $ * $Id: kern_xxx.c,v 1.12 1994/03/18 18:57:15 mycroft Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -166,9 +166,9 @@ uname(p, uap, retval)
struct uname_args *uap; struct uname_args *uap;
int *retval; int *retval;
{ {
bcopy(hostname, utsname.nodename, sizeof(utsname.nodename)); strncpy(utsname.nodename, hostname, sizeof(utsname.nodename)-1);
utsname.nodename[sizeof(utsname.nodename)-1] = '\0'; return (copyout((caddr_t)&utsname, (caddr_t)uap->name,
return (copyout((caddr_t)&utsname, (caddr_t)uap->name, sizeof(struct utsname))); sizeof(struct utsname)));
} }
struct reboot_args { struct reboot_args {