[fpc-devel]Re: array of char

Peter Vreman peter at freepascal.org
Sat Sep 30 14:08:24 CEST 2000


At 09:59 29-9-00, you wrote:
>Jonas Maebe schrieb:
> > >Thus, the shortstring Concatenation operation truncated your string before
> > >it is passed to the const.
> >
> > This is correct.
>
>No, it isn't. The strings are concatened as ansistrings but
>when writing the constant, the string is cut off to 255 chars, see
>ptconst.pas
>around line 540:
>
>                    p:=comp_expr(true);
>                    do_firstpass(p);
>                    if p^.treetype=stringconstn then
>                     begin
>                       if p^.length>255 then
>                        len:=255
>                              ^--- should we fix this?
>                       else
>                        len:=p^.length;
>                       s[0]:=chr(len);
>                       move(p^.value_str^,s[1],len);
>                     end

Fixed. Only for tp mode the length is now limited to 255. Also for pchars 
the length is limited to 255 in tp mode.


Peter





More information about the fpc-devel mailing list