Compare commits

...

1 Commits

Author SHA1 Message Date
Dirk Hohndel
789f55f53d Don't crash when we see too many O2 sensors
I can think of very, very, VERY few circumstances where it makes sense to crash
an end user application. This isn't one of them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-15 17:37:55 -08:00

View File

@ -6,7 +6,6 @@
#include "gettext.h" #include "gettext.h"
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "dive.h" #include "dive.h"
@ -1156,7 +1155,8 @@ static int calculate_ccr_po2(struct plot_data *entry, const struct divecomputer
return sump / 3; return sump / 3;
} }
default: // This should not happen default: // This should not happen
assert(np <= 3); // assert(np <= 3);
printf("calculate_ccr_po2: np > 3 -- that's a problem, but maybe not enough to crash the app\n");
return 0; return 0;
} }
} }