[fpc-pascal] Is it save to think default value of untouched string is ''?

Jorge Aldo G. de F. Junior jagfj80 at gmail.com
Wed Mar 17 13:52:09 CET 2010


security rule #1 : never assume anything...

2010/3/7 lyh1 <lyh1win at hotmail.com>:
> But ShortStrings also store the length in string[0]. If I do a append, I
> think the string will append to string[1]....
> So don't assume string are always initialized with null string?
>
>>
>> Message: 5
>> Date: Sun, 7 Mar 2010 00:17:03 +0100
>> From: Mattias Gaertner <nc-gaertnma at netcologne.de>
>> Subject: Re: [fpc-pascal] Is it save to think default value of
>> untouched string is ''?
>> To: fpc-pascal at lists.freepascal.org
>> Message-ID: <20100307001703.2a1b2bb9 at limapholos>
>> Content-Type: text/plain; charset=US-ASCII
>>
>
>>
>> SetLength does not initialize the string characters.
>> ShortStrings are not always initialized.
>>
>> Mattias
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list