ip = 0;
// Allocate two pages at the next page boundary.
- // Make the first inaccessible.
- // Use the second as the user stack.
+ // Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
goto bad;
for(argc = 0; argv[argc]; argc++) {
if(argc >= MAXARG)
goto bad;
- sp -= strlen(argv[argc]) + 1;
- sp &= ~3;
+ sp = (sp - strlen(argv[argc]) + 1) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3+argc] = sp;
proc->tf->esp = sp;
switchuvm(proc);
freevm(oldpgdir);
-
return 0;
bad: