std.file functions and embedded NUL characters [CWE-158]
Steven Schveighoffer
schveiguy at gmail.com
Fri Aug 1 00:48:36 UTC 2025
On Friday, 1 August 2025 at 00:22:20 UTC, monkyyy wrote:
> On Friday, 1 August 2025 at 00:11:51 UTC, Steven Schveighoffer
> wrote:
>>
>> If we checked for mid-string zero terminators on all calls to
>> `toStringz`, we would kill performance where mostly it isn't
>> necessary
>
> I bet the speed test is effectively a tie if its reasonably
> written
How do you "reasonably" write a linear search?
Sure you can make it a faster O(n), but it's still O(n). Whereas
just "add on a 0 if not there" is an O(1) operation.
-Steve
More information about the Digitalmars-d
mailing list