Do not return an error when no dives are present.

This commit is contained in:
Jef Driesen 2011-01-19 08:25:03 +01:00
parent 104c4d956a
commit de1f7511ac
2 changed files with 4 additions and 0 deletions

View File

@ -374,6 +374,8 @@ cressi_edy_device_foreach (device_t *abstract, dive_callback_t callback, void *u
unsigned int first = config[0x7D];
if (first < RB_LOGBOOK_BEGIN || first >= RB_LOGBOOK_END ||
last < RB_LOGBOOK_BEGIN || last >= RB_LOGBOOK_END) {
if (last == 0xFF)
return DEVICE_STATUS_SUCCESS;
WARNING ("Invalid ringbuffer pointer detected.");
return DEVICE_STATUS_ERROR;
}

View File

@ -310,6 +310,8 @@ zeagle_n2ition3_device_foreach (device_t *abstract, dive_callback_t callback, vo
unsigned int first = config[0x7D];
if (first < RB_LOGBOOK_BEGIN || first >= RB_LOGBOOK_END ||
last < RB_LOGBOOK_BEGIN || last >= RB_LOGBOOK_END) {
if (last == 0xFF)
return DEVICE_STATUS_SUCCESS;
WARNING ("Invalid ringbuffer pointer detected.");
return DEVICE_STATUS_ERROR;
}