commit c4696a306e1d50ccd05093ee1985e4e64e3044b6
parent e537f7bd426641e830bd464de294ddf627e451f5
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Tue, 27 Feb 2024 17:52:40 +0100
Change an assert to returning error.
This in a part of the code where errors can be ok (if this run is to
create dumps, not for compute).
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/stardis-app.c b/src/stardis-app.c
@@ -106,7 +106,11 @@ check_delta_and_create_solid
external = 1;
} else {
double d = header.volume / (header.area * 6);
- ASSERT(d >= 0);
+ if(d <= 0) {
+ /* Should not */
+ res = RES_BAD_OP;
+ goto error;
+ }
delta_range[0] = MMIN(delta_range[0], d);
delta_range[1] = MMAX(delta_range[1], d);
}