From f297d9f91e5919c180d15be9562b8e15e6dd368e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 8 Jul 2014 12:29:06 -0700 Subject: Fix picture loading Signed vs unsigned comparisons are such a pain. Since we want offsets to be +/- 30 minutes around the dive we need to allow negative offsets - but duration_t was defined as uint32_t. Signed-off-by: Dirk Hohndel --- dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dive.c') diff --git a/dive.c b/dive.c index e4ad78cb9..ce04bd54e 100644 --- a/dive.c +++ b/dive.c @@ -2389,7 +2389,7 @@ void dive_create_picture(struct dive *d, char *filename, int shift_time) picture_load_exif_data(p, ×tamp); if (timestamp) { p->offset.seconds = timestamp - d->when + shift_time; - if (p->offset.seconds < -D30MIN || p->offset.seconds > d->duration.seconds + D30MIN) { + if (p->offset.seconds < -D30MIN || p->offset.seconds > (int)d->duration.seconds + D30MIN) { // this picture doesn't belong to this dive free(p); return; -- cgit v1.2.3-70-g09d2