SCCS-vsn: sys/kern/kern_proc.c 4.62
-/* kern_proc.c 4.61 83/04/06 */
+/* kern_proc.c 4.62 83/05/18 */
#include "../machine/reg.h"
#include "../machine/pte.h"
#include "../machine/reg.h"
#include "../machine/pte.h"
register u_int len;
len = uap->len;
register u_int len;
len = uap->len;
- if (len > hostnamelen)
- len = hostnamelen;
+ if (len > hostnamelen + 1)
+ len = hostnamelen + 1;
u.u_error = copyout((caddr_t)hostname, (caddr_t)uap->hostname, len);
}
u.u_error = copyout((caddr_t)hostname, (caddr_t)uap->hostname, len);
}
u.u_error = EINVAL;
return;
}
u.u_error = EINVAL;
return;
}
- hostnamelen = uap->len + 1;
+ hostnamelen = uap->len;
u.u_error = copyin((caddr_t)uap->hostname, hostname, uap->len);
u.u_error = copyin((caddr_t)uap->hostname, hostname, uap->len);
- hostname[uap->len] = 0;
+ hostname[hostnamelen] = 0;
qclean();
#endif
#ifdef sun
qclean();
#endif
#ifdef sun
#endif
vrelpt(u.u_procp);
vrelu(u.u_procp, 0);
#endif
vrelpt(u.u_procp);
vrelu(u.u_procp, 0);