diff options
| author | Neil <nyamatongwe@gmail.com> | 2019-06-04 13:13:51 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2019-06-04 13:13:51 +1000 | 
| commit | f1e5d3fe578f201618a63afb48646dcd5506685d (patch) | |
| tree | ae27c2edb84dfe7af51dcd44552ca2040408b4e4 /src | |
| parent | f82ccf0be4becb37bb450b3f745a1e611b7cc37c (diff) | |
| download | scintilla-mirror-f1e5d3fe578f201618a63afb48646dcd5506685d.tar.gz | |
Bug [#2104]. Use '%.0f' and casts to double to fix printf format string bugs.
This will extend valid maximum position from 31-bits to 53-bits which is ample.
Diffstat (limited to 'src')
| -rw-r--r-- | src/CellBuffer.cxx | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index f2445751f..acdfc6e5c 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -559,8 +559,10 @@ void CellBuffer::GetCharRange(char *buffer, Sci::Position position, Sci::Positio  	if (position < 0)  		return;  	if ((position + lengthRetrieve) > substance.Length()) { -		Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", position, -		                      lengthRetrieve, substance.Length()); +		Platform::DebugPrintf("Bad GetCharRange %.0f for %.0f of %.0f\n", +				      static_cast<double>(position), +				      static_cast<double>(lengthRetrieve), +				      static_cast<double>(substance.Length()));  		return;  	}  	substance.GetRange(buffer, position, lengthRetrieve); @@ -580,8 +582,10 @@ void CellBuffer::GetStyleRange(unsigned char *buffer, Sci::Position position, Sc  		return;  	}  	if ((position + lengthRetrieve) > style.Length()) { -		Platform::DebugPrintf("Bad GetStyleRange %d for %d of %d\n", position, -		                      lengthRetrieve, style.Length()); +		Platform::DebugPrintf("Bad GetStyleRange %.0f for %.0f of %.0f\n", +				      static_cast<double>(position), +				      static_cast<double>(lengthRetrieve), +				      static_cast<double>(style.Length()));  		return;  	}  	style.GetRange(reinterpret_cast<char *>(buffer), position, lengthRetrieve); | 
