Correctly detect a device without any dives.

If the dive computer has not recorded any dives yet, the profile pointer
isn't valid and contains the default value 0xFFFFFFFF. There is no need
to return an error in this case.
This commit is contained in:
Gilbert J. M. Forkel 2015-12-06 18:32:52 +01:00 committed by Jef Driesen
parent a4838e7cfc
commit 07c9cf8950

View File

@ -478,6 +478,8 @@ mares_iconhd_extract_dives (dc_device_t *abstract, const unsigned char data[], u
break;
}
if (eop < layout->rb_profile_begin || eop >= layout->rb_profile_end) {
if (eop == 0xFFFFFFFF)
return DC_STATUS_SUCCESS; // No dives available.
ERROR (context, "Ringbuffer pointer out of range (0x%08x).", eop);
return DC_STATUS_DATAFORMAT;
}