Hello!

> procedure LoginSocketDocEnd(Sender: TObject);
> var p: PChar;
>    s: string;
> begin
>  p := TMemoryStream(LoginSocket.RcvdStream).Memory;
>  s:= Copy(StrPas(p), 1, LoginSocket.RcvdStream.Size);

This will crash if source TMemoryStream doesn't end with #0. Moreover,
this copies data twice (wastes time and memory). 

Use this:

SetLength(s, LoginSocket.RcvdStream.Size);
Move(TMemoryStream(LoginSocket.RcvdStream).Memory^, pointer(s)^,
LoginSocket.RcvdStream.Size);

-- 
Piotr Dałek
[EMAIL PROTECTED]

----------------------------------------------------------------------  
Prosty kredyt na wszystkie potrzeby. 
Od 1000 zl do 120 000 zl. 
Bez poreczycieli i zabezpieczen >>> http://link.interia.pl/f1edf

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to