mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 12:39:38 +01:00 
			
		
		
		
	* make sure that when making an ansistring shorter using setlength(),
it remains null-terminated git-svn-id: branches/jvmbackend@18883 -
This commit is contained in:
		
							parent
							
								
									3a423b331c
								
							
						
					
					
						commit
						7c56dbee12
					
				@ -417,6 +417,8 @@ begin
 | 
			
		||||
    result:=s;
 | 
			
		||||
  { +1 for terminating #0 }
 | 
			
		||||
  setlength(AnsistringClass(result).fdata,l+1);
 | 
			
		||||
  { null-terminate in case the string became shorter }
 | 
			
		||||
  AnsistringClass(result).fdata[l]:=#0;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
{*****************************************************************************
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user