mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 06:19:37 +01:00 
			
		
		
		
	* provide terminating #0's to wide and stringfields, Patch from Ludo Brands
Mantis 199222 git-svn-id: trunk@18140 -
This commit is contained in:
		
							parent
							
								
									084c06586a
								
							
						
					
					
						commit
						cf061cd3ae
					
				@ -1102,6 +1102,7 @@ begin
 | 
			
		||||
  if DataSize <= dsMaxStringSize then
 | 
			
		||||
    begin
 | 
			
		||||
    Result:=GetData(@Buf);
 | 
			
		||||
    buf[Size]:=#0;  //limit string to Size
 | 
			
		||||
    If Result then
 | 
			
		||||
      begin
 | 
			
		||||
      if transliterate then
 | 
			
		||||
@ -1117,6 +1118,7 @@ begin
 | 
			
		||||
    begin
 | 
			
		||||
    SetLength(DynBuf,DataSize);
 | 
			
		||||
    Result:=GetData(@DynBuf[0]);
 | 
			
		||||
    Dynbuf[Size]:=#0;  //limit string to Size
 | 
			
		||||
    If Result then
 | 
			
		||||
      begin
 | 
			
		||||
      if transliterate then
 | 
			
		||||
@ -1223,11 +1225,13 @@ var
 | 
			
		||||
begin
 | 
			
		||||
  if DataSize <= dsMaxStringSize then begin
 | 
			
		||||
    Result := GetData(@FixBuffer, False);
 | 
			
		||||
    FixBuffer[Size]:=#0;     //limit string to Size
 | 
			
		||||
    aValue := FixBuffer;
 | 
			
		||||
  end else begin
 | 
			
		||||
    SetLength(DynBuffer, Succ(Size));
 | 
			
		||||
    Buffer := PWideChar(DynBuffer);
 | 
			
		||||
    Result := GetData(Buffer, False);
 | 
			
		||||
    Buffer[Size]:=#0;     //limit string to Size
 | 
			
		||||
    if Result then
 | 
			
		||||
      aValue := Buffer;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user