Compare image times and sample times as signed ints

The problem that we were comparing signed and unsigned ints was originally
found by Lubomir. As image times can be negative (and the comparison should
fail in that case) we need to compared them as signed.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2014-10-27 21:41:20 +01:00 committed by Dirk Hohndel
parent aeebe8519d
commit a2f9f0c8bf

View file

@ -334,7 +334,7 @@ void DiveLogExportDialog::export_depths(const char *filename, const bool selecte
int n = dive->dc.samples;
struct sample *s = dive->dc.sample;
depth.mm = 0;
while (--n >= 0 && s->time.seconds <= picture->offset.seconds) {
while (--n >= 0 && (int32_t)s->time.seconds <= picture->offset.seconds) {
depth.mm = s->depth.mm;
s++;
}