summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/syscall.c b/syscall.c
index b44a7a9..adc2b58 100644
--- a/syscall.c
+++ b/syscall.c
@@ -37,15 +37,15 @@ fetchint(struct proc *p, uint addr, int *ip)
int
fetchstr(struct proc *p, uint addr, char **pp)
{
- char *cp, *ep;
+ char *s, *ep;
if(addr >= p->sz)
return -1;
*pp = p->mem + addr;
ep = p->mem + p->sz;
- for(cp = *pp; cp < ep; cp++)
- if(*cp == 0)
- return cp - *pp;
+ for(s = *pp; s < ep; s++)
+ if(*s == 0)
+ return s - *pp;
return -1;
}
@@ -53,9 +53,9 @@ fetchstr(struct proc *p, uint addr, char **pp)
int
argint(int argno, int *ip)
{
- struct proc *p = curproc[cpu()];
+ struct proc *cp = curproc[cpu()];
- return fetchint(p, p->tf->esp + 4 + 4*argno, ip);
+ return fetchint(cp, cp->tf->esp + 4 + 4*argno, ip);
}
// Fetch the nth word-sized system call argument as a pointer
@@ -65,13 +65,13 @@ int
argptr(int argno, char **pp, int size)
{
int i;
- struct proc *p = curproc[cpu()];
+ struct proc *cp = curproc[cpu()];
if(argint(argno, &i) < 0)
return -1;
- if((uint)i >= p->sz || (uint)i+size >= p->sz)
+ if((uint)i >= cp->sz || (uint)i+size >= cp->sz)
return -1;
- *pp = p->mem + i;
+ *pp = cp->mem + i;
return 0;
}