mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Fix seabear import sample overrun bug
The Seabear import fixed up the NDL and TTS in the samples from minutes (in the import) to seconds (our internal format for all time). But it did it with a loop that overran the end of the samples array by one: for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) { Fix it to use the proper "<" instead of "<=". Reported-by: Stuart Vernon <stuartv@force2.net> Tested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ccff227596
commit
effad4b2c8
1 changed files with 1 additions and 1 deletions
|
@ -782,7 +782,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
|
|||
}
|
||||
// Seabear CSV stores NDL and TTS in Minutes, not seconds
|
||||
struct dive *dive = dive_table.dives[dive_table.nr - 1];
|
||||
for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {
|
||||
for(int s_nr = 0 ; s_nr < dive->dc.samples ; s_nr++) {
|
||||
struct sample *sample = dive->dc.sample + s_nr;
|
||||
sample->ndl.seconds *= 60;
|
||||
sample->tts.seconds *= 60;
|
||||
|
|
Loading…
Reference in a new issue