On Tue, May 25, 2010 at 5:37 AM, Mark Phalan <mark.pha...@sun.com> wrote:
>
>
> Another data point. This works fine:
>
>   data_string = lltostr(strlen(stringof(copyin((uintptr_t)(*((uint32_t
> *)
>       copyin((uintptr_t)&P->data, sizeof (uint32_t)))), *((uint32_t *)
>       copyin((uintptr_t)&P->length, sizeof (uint32_t))) -1))));
>
> i.e. strlen seems to work fine on the result of stringof() and returns
> "3".

Yep.  Again, you're copying data into what's currently a zeroed area
of memory, so you'll get a null-terminated string as long as you're
not writing anything more into scratch space.  When you do the
strjoin() in the other example, you overwrite the nulls that existed
there by default.

Chad
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to