Don't explicitly null-terminate. The buffer we are copying into is

already zeroed, and we explicitly leave the last byte untouched.

Submitted by: bde
This commit is contained in:
Peter Wemm 2001-08-16 20:16:20 +00:00
parent d3ab0d02cf
commit a75a0c55f4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81799

View file

@ -942,7 +942,6 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
psinfo->pr_version = PRPSINFO_VERSION;
psinfo->pr_psinfosz = sizeof(prpsinfo_t);
strncpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname) - 1);
psinfo->pr_fname[sizeof(psinfo->pr_fname) - 1] = '\0';
/* XXX - We don't fill in the command line arguments properly yet. */
strncpy(psinfo->pr_psargs, p->p_comm, PRARGSZ);