mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:49:39 +02:00
* Fixed handling of zero-length strings (classes.inc: When converting
empty strings from text forms to binary forms; reader.inc: When reading an empty string from a binary serialization)
This commit is contained in:
parent
867e68938f
commit
3b8e03aef6
@ -880,7 +880,8 @@ var
|
|||||||
procedure WriteString(s: String);
|
procedure WriteString(s: String);
|
||||||
begin
|
begin
|
||||||
Output.WriteByte(Length(s));
|
Output.WriteByte(Length(s));
|
||||||
Output.Write(s[1], Length(s));
|
if Length(s) > 0 then
|
||||||
|
Output.Write(s[1], Length(s));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure WriteInteger(value: LongInt);
|
procedure WriteInteger(value: LongInt);
|
||||||
@ -1189,7 +1190,12 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.10 2002-09-07 15:15:24 peter
|
Revision 1.11 2002-12-02 12:04:07 sg
|
||||||
|
* Fixed handling of zero-length strings (classes.inc: When converting
|
||||||
|
empty strings from text forms to binary forms; reader.inc: When reading
|
||||||
|
an empty string from a binary serialization)
|
||||||
|
|
||||||
|
Revision 1.10 2002/09/07 15:15:24 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
Revision 1.9 2002/07/16 13:32:51 florian
|
Revision 1.9 2002/07/16 13:32:51 florian
|
||||||
|
@ -194,7 +194,8 @@ var
|
|||||||
begin
|
begin
|
||||||
Read(i, 1);
|
Read(i, 1);
|
||||||
SetLength(Result, i);
|
SetLength(Result, i);
|
||||||
Read(Pointer(@Result[1])^, i);
|
if i > 0 then
|
||||||
|
Read(Pointer(@Result[1])^, i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBinaryObjectReader.ReadString(StringType: TValueType): String;
|
function TBinaryObjectReader.ReadString(StringType: TValueType): String;
|
||||||
@ -1267,7 +1268,12 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2002-09-07 15:15:25 peter
|
Revision 1.7 2002-12-02 12:04:07 sg
|
||||||
|
* Fixed handling of zero-length strings (classes.inc: When converting
|
||||||
|
empty strings from text forms to binary forms; reader.inc: When reading
|
||||||
|
an empty string from a binary serialization)
|
||||||
|
|
||||||
|
Revision 1.6 2002/09/07 15:15:25 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user