mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 08:29:45 +01:00
* Fixed fpc_WideCharArray_To_WideStr in case if widechar array contains empty string.
+ Test. git-svn-id: trunk@8317 -
This commit is contained in:
parent
65afe53eb0
commit
685810c18c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6364,6 +6364,7 @@ tests/tbs/tb0537.pp svneol=native#text/plain
|
|||||||
tests/tbs/tb0538.pp svneol=native#text/plain
|
tests/tbs/tb0538.pp svneol=native#text/plain
|
||||||
tests/tbs/tb0539.pp svneol=native#text/plain
|
tests/tbs/tb0539.pp svneol=native#text/plain
|
||||||
tests/tbs/tb0540.pp svneol=native#text/x-pascal
|
tests/tbs/tb0540.pp svneol=native#text/x-pascal
|
||||||
|
tests/tbs/tb0541.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0119.pp svneol=native#text/plain
|
tests/tbs/ub0119.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -747,9 +747,7 @@ begin
|
|||||||
else
|
else
|
||||||
i := high(arr)+1;
|
i := high(arr)+1;
|
||||||
SetLength(fpc_WideCharArray_To_WideStr,i);
|
SetLength(fpc_WideCharArray_To_WideStr,i);
|
||||||
Move(pwidechar(@arr)^, PWideChar(Pointer(@fpc_WideCharArray_To_WideStr[1]))^,i*sizeof(WideChar));
|
Move(arr[0], Pointer(fpc_WideCharArray_To_WideStr)^,i*sizeof(WideChar));
|
||||||
{ Terminating Zero }
|
|
||||||
PWideChar(Pointer(@fpc_WideCharArray_To_WideStr[1])+i*sizeof(WideChar))^:=#0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifndef FPC_STRTOCHARARRAYPROC}
|
{$ifndef FPC_STRTOCHARARRAYPROC}
|
||||||
|
|||||||
14
tests/tbs/tb0541.pp
Normal file
14
tests/tbs/tb0541.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
const
|
||||||
|
TestStr: widestring = 'Test';
|
||||||
|
|
||||||
|
var
|
||||||
|
buf: array[0..10] of widechar;
|
||||||
|
s: widestring;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Move(TestStr[1], buf[0], (Length(TestStr) + 1)*SizeOf(widechar));
|
||||||
|
s:=buf;
|
||||||
|
writeln(s);
|
||||||
|
buf[0]:=#0;
|
||||||
|
s:=buf;
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user