Re: [DTrace-devel] [PATCH v2] string: ensure string size is handled correctly

Kris Van Hees <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <[email protected]>
On Thu, Aug 14, 2025 at 12:29:10PM -0400, Eugene Loh wrote:
> Typo:  s/strsuze/strsize/
> 
> For tracking purposes, should this patch be prefaced 5/5?

Either way.  The tracking I do does not actually use the 5/5 etc because
revisions in oatch series often cause thosse numbers to get skewed, e.g.
when we need to add an additional patch somewhere in the series to address
an issue.

> I think the .r files need to be updated for

Woops, forgot to git add them.  v3 on the way

> 
> test/unittest/codegen/tst.str_const_length.r
> -         0: 61 62 63 64 65 00 abcde.
> +         0: 61 62 63 64 00 abcd.
> 
> test/unittest/codegen/tst.str_data_size.r
> -         0: 64 74 72 61 63 00 dtrac.
> +         0: 64 74 72 61 00 dtra.
> 
> test/unittest/variables/tvar/tst.str-size.r
> -abcdabcdabcd
> +abcabcabc
> 
> Also, need to check test/unittest/funcs/strlen/tst.capped-sizw.d.
> 
> On 8/13/25 23:57, Kris Van Hees via DTrace-devel wrote:
> > A string is defined as a character array of size strsize.  Strings
> > that are less that strsize in length are terminated by a NUL byte.
> > This implies that the NUL byte is part of the array and therefore,
> > strsuze is indeed the size of the array and not the maximum number
> > of characters in the string.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.