mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Fix possible /0 error
This commit is contained in:
parent
57c1b16f8f
commit
2ad07322d6
1 changed files with 1 additions and 1 deletions
|
@ -1199,7 +1199,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
// TODO consider '\r' line endings?
|
||||
if (buffer[i] == '\n') {
|
||||
if (lineOffsets.length == lines) {
|
||||
final int ratio= Math.min(i / lines, 20);
|
||||
final int ratio= Math.min(Math.max(i / lines, 1), 20);
|
||||
int[] tmp= new int[lines + (buffer.length - i) / ratio + 1];
|
||||
System.arraycopy(lineOffsets, 0, tmp, 0, lines);
|
||||
lineOffsets= tmp;
|
||||
|
|
Loading…
Add table
Reference in a new issue