On Wed, 27 Jun 2007 19:38:03 +0200 Luca Olivetti <[EMAIL PROTECTED]> wrote:
> En/na Luca Olivetti ha escrit: > > En/na Cesar Romero ha escrit: > >> Where S is initialized? > >> I only see L initialized. > >> > >> []s > >> > >> > >> Cesar Romero > >>> > >>> 442: L:=length(s); > >>> 443: if L<1 then exit; > >>> 444: case s[1] of > >>> > >>> so I can't see how it could possibly be uninitialized. > > > > nothwithstanding the fact that if length(s)<1 line 444 won't be > > executed, so the "uninitialized" should be flagged in line 442, I know > > that this chunk is inside > > > > procedure TButlerPhone.Receive(s: string); > > > > so s is a parameter. > > This procedure is called exclusively from > > > > procedure TStatusThread.Receive; > > begin > > FOwner.Receive(FData) > > end; > > > > (FOwner is a TButlerPhone) > > > > which in turn is called only here: > > > > FData:=copy(buffer,i+2,L-1); > > if buffer[i+L+1]=checksum(FData) then > > begin > > if not terminated then synchronize(@Receive); > > end else > > > > And another writeln confirms that L is 1 when valgrind complains, so the > string is definitely initialized. Did you write to that string or merely set its length using SetLength? Vincent _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal