Adam Naumowicz wrote:
I've just noticed that there is a bug in the string assignment if a string is passed by value to a procedure and then assigned to.
It's not a bug. `String' is a schema type which adjusts to the actual parameter. In this case it has a capacity of 1 (since the value passed is a constant, the capacity is set equal to its length). So assigning anything longer will not fit.
(Or to express it low-level, as some people seem to prefer: How much space should the compiler allocate on the stack for the parameter? It can't know in advance how long a value you're going to assign to it.)
If you're used to BP where `String' means `String [255]', you might want to write so (or you might want to use `TString' from module GPC which is a bit longer). But any fixed length may, of course, overrun, unless you've verified what you're actually assigning to it ...
Frank