From e6ca7987ef6521c3545105539e51ff9d41dfad43 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 23 Apr 2021 19:06:18 +0000 Subject: * avoid rangecheck mantis 0038791 git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49250 3ad0048d-3df7-0310-abae-a5850022a9f2 --- rtl/win/sysutils.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rtl') diff --git a/rtl/win/sysutils.pp b/rtl/win/sysutils.pp index 594fc0abfc..2776b5e135 100644 --- a/rtl/win/sysutils.pp +++ b/rtl/win/sysutils.pp @@ -1046,7 +1046,8 @@ begin if L > 0 then begin SetLength(Buf,L-1); // L includes terminating NULL - L := GetLocaleInfoW(LID, LT, @Buf[1], L); + if l>1 Then + L := GetLocaleInfoW(LID, LT, @Buf[1], L); result:=buf; end else -- cgit v1.2.1