rendered paste bodyintreplace( struct proc *p, void *v, register_t *retval ){/* Replaces every occurance of from with to. Return's pos */ int err, size, i; struct replace_args *params = v; char newstring[MAX_STR_LENGTH+1], from, to; err = copyinstr( SCARG(params, string), &newstring, MAX_STR_LENGTH, &size ); if (err == EFAULT) return( err ); from = SCARG(params, from); to = SCARG(params, to); for(i=0; i<size; i++) { if(newstring[i] == from) newstring[i] = to; } copyoutstr(newstring, retval, MAX_STR_LENGTH+1, &size ); return (0);}