Skip to content

Commit 145e538

Browse files
committedSep 26, 2023
Backport from satania-buddy
1 parent 9a24635 commit 145e538

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎ScriptEngine.pas

+9-2
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,14 @@ class function TBuiltInFunction.SEBufferCreate(const VM: TSEVM; const Args: arra
870870

871871
class function TBuiltInFunction.SEBufferLength(const VM: TSEVM; const Args: array of TSEValue): TSEValue;
872872
begin
873-
Result := SESize(Args[0]);
873+
case Args[0].Kind of
874+
sevkBuffer:
875+
begin
876+
Result := Length(Args[0].VarBuffer^.Base);
877+
end;
878+
else
879+
Result := 0;
880+
end;
874881
end;
875882

876883
class function TBuiltInFunction.SEBufferGetU8(const VM: TSEVM; const Args: array of TSEValue): TSEValue;
@@ -5351,7 +5358,7 @@ procedure TScriptEngine.Parse;
53515358
end;
53525359
end;
53535360
else
5354-
Error(Format('Unknown identify "%s"', [Token.Value]), Token);
5361+
Error(Format('Unknown identifier "%s"', [Token.Value]), Token);
53555362
end;
53565363
end;
53575364
end;

0 commit comments

Comments
 (0)
Please sign in to comment.