> /*
>  * return number of characters in a userland address string
>  * or -1 if an illegal access occurs.
>  */
> int
> user_strlen(uaddr)
>       char *uaddr;
> {
>       int ret;
> 
>       ret = -1;
>       do {
>               ch = fubyte(uaddr);
>               ret++;
>       } while (ch != 0 && ch != -1);
> 
>       return (ch == -1 ? -1 : ret);
> }

Then I don't get it. Won't this piece of code cycle forever fetching
first byte of the string again and again ? According to fetch(9)
fubyte() doesn't change uaddr, or am I missing something again ?
Am I allowed to do uaddr++ for userspace addresses in such a case ?

Regards,
Eugene


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to