summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 6ad21aa1f..b27eff218 100644
--- a/dive.h
+++ b/dive.h
@@ -436,7 +436,7 @@ static inline struct dive *get_dive_by_uemis_diveid(uint32_t diveid, uint32_t de
return NULL;
}
-static inline struct dive *getDiveById(int id)
+static inline struct dive *get_dive_by_diveid(int id)
{
int i;
struct dive *dive = NULL;
@@ -445,6 +445,12 @@ static inline struct dive *getDiveById(int id)
if (dive->id == id)
break;
}
+#ifdef DEBUG
+ if(dive == NULL){
+ fprintf(stderr, "Invalid id %x passed to get_dive_by_diveid, try to fix the code\n", id);
+ exit(1);
+ }
+#endif
return dive;
}