Remove some unused variables and fix two blatant core dump triggers.

This commit is contained in:
phk 1995-02-24 08:15:27 +00:00
parent a96d1683ee
commit 5ca4449181
3 changed files with 9 additions and 11 deletions

View File

@ -280,20 +280,21 @@ kvm_openfiles(uf, mf, sf, flag, errout)
}
kvm_t *
kvm_open(uf, mf, sf, flag, program)
kvm_open(uf, mf, sf, flag, errstr)
const char *uf;
const char *mf;
const char *sf;
int flag;
const char *program;
const char *errstr;
{
register kvm_t *kd;
if ((kd = malloc(sizeof(*kd))) == NULL && program != NULL) {
(void)fprintf(stderr, "%s: %s\n", strerror(errno));
if ((kd = malloc(sizeof(*kd))) == NULL) {
(void)fprintf(stderr, "%s: %s\n",
errstr ? errstr : "kvm_open" , strerror(errno));
return (0);
}
kd->program = program;
kd->program = errstr;
return (_kvm_open(kd, uf, mf, sf, flag, NULL));
}

View File

@ -78,10 +78,9 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
int op, arg, nfiles;
long filehead_o;
{
int buflen = kd->arglen, needed = buflen, error, n = 0;
struct file *fp, file, *filehead;
int buflen = kd->arglen, n = 0;
struct file *fp, *filehead;
register char *where = kd->argspc;
char *start = where;
/*
* first copyout filehead

View File

@ -465,6 +465,7 @@ kvm_argv(kd, p, addr, narg, maxcnt)
return (kd->argv);
}
}
return (0);
}
static void
@ -579,9 +580,6 @@ kvm_uread(kd, p, uva, buf, len)
char procfile[MAXPATHLEN];
ssize_t amount;
int fd;
u_long tmpuva = uva;
int i;
char *chr;
cp = buf;