emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master d995429e7bc: Use SBYTES instead of strlen in treesit.c


From: Stefan Kangas
Subject: Re: master d995429e7bc: Use SBYTES instead of strlen in treesit.c
Date: Mon, 22 Jul 2024 04:55:00 -0700

Eli Zaretskii <eliz@gnu.org> writes:

>> > Have you verified that these functions accept strings holding '\0'?
>>
>> AFAIK, SBYTES returns the string length excluding '\0', same as strlen.
>
> That's not the issue here.  The issue is that Emacs Lisp strings can
> include embedded null bytes, which strlen will exclude, but SBYTES
> will not.

We avoid that when they are converted from a sexp (see
treesit_query_string_string).

Perhaps we should do the same when we get a string?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]