Skip to content

Error 201 on TSimpleMsgPack.setAsString if string is empty #3

Description

@cpicanco
    procedure TSimpleMsgPack.setAsString(pvValue: string);
    begin
      FDataType := mptString;
      if SizeOf(Char) = 2 then
      begin
        SetLength(FValue, length(pvValue) shl 1);
        Move(PChar(pvValue)^, FValue[0], Length(FValue));
      end else
      begin
        SetLength(FValue, length(pvValue));
        Move(PChar(pvValue)^, FValue[0], Length(FValue)); // <<<<<<<<< error Runtime (201)
      end;
    end;

Any suggestion will be appreciated.

Docs for me:
http://wiki.freepascal.org/Character_and_string_types
http://www.freepascal.org/docs-html/rtl/system/stringfunctions.html
http://www.freepascal.org/docs-html/ref/refsu10.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions