Idea: Introduce zero-terminated string specifier

Paulo Pinto pjmlp at progtools.org
Thu Oct 4 01:38:35 PDT 2012


On Tuesday, 2 October 2012 at 13:07:46 UTC, deadalnix wrote:
> Le 01/10/2012 22:33, Vladimir Panteleev a écrit :
>> On Monday, 1 October 2012 at 12:12:52 UTC, deadalnix wrote:
>>> Le 01/10/2012 13:29, Vladimir Panteleev a écrit :
>>>> On Monday, 1 October 2012 at 10:56:36 UTC, deadalnix wrote:
>>>>> How does to!string know that the string is 0 terminated ?
>>>>
>>>> By convention (it doesn't).
>>>
>>> It is unsafe as hell oO
>>
>> Forcing the programmer to put strlen calls everywhere in his 
>> code is not
>> any safer.
>
> I make the library safer. If the programmer manipulate unsafe 
> construct (like c strings) it is up to the programmer to ensure 
> safety, not the lib.

Thrusting the programmer is what brought upon us the wrath of 
security exploits via buffer overflows.

--
Paulo


More information about the Digitalmars-d mailing list