* Eugene L. Vorokov <[EMAIL PROTECTED]> [010713 10:16] wrote:
> > /*
> > * return number of characters in a userland address string
> > * or -1 if an illegal access occurs.
> > */
> 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 ?
Yes, I forgot something:
> > int
> > user_strlen(uaddr)
> > char *uaddr;
> > {
> > int ret;
> >
> > ret = -1;
> > do {
> > ch = fubyte(uaddr);
> > ret++;
----------> uaddr++; <-------------
> > } while (ch != 0 && ch != -1);
> >
> > return (ch == -1 ? -1 : ret);
> > }
>
doh :)
--
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message