From: Holger Schemel Date: Sun, 25 Feb 2024 00:18:15 +0000 (+0100) Subject: fixed using strtod() by resetting errno to detect overflow/underflow X-Git-Tag: 4.4.0.0-test-1~286 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;ds=sidebyside;h=a5ccc4066f45d447dfddec469d4da3572a0f83c8;p=rocksndiamonds.git fixed using strtod() by resetting errno to detect overflow/underflow --- diff --git a/src/game_bd/bd_bdcff.c b/src/game_bd/bd_bdcff.c index 8f2ee081..4c57c14e 100644 --- a/src/game_bd/bd_bdcff.c +++ b/src/game_bd/bd_bdcff.c @@ -254,6 +254,7 @@ static boolean struct_set_property(gpointer str, const GdStructDescriptor *prop_ break; case GD_TYPE_PROBABILITY: + errno = 0; /* must be reset before calling strtod() to detect overflow/underflow */ res = strtod(params[paramindex], NULL); if (errno == 0 && res >= 0 && res <= 1) { @@ -268,6 +269,7 @@ static boolean struct_set_property(gpointer str, const GdStructDescriptor *prop_ break; case GD_TYPE_RATIO: + errno = 0; /* must be reset before calling strtod() to detect overflow/underflow */ res = strtod (params[paramindex], NULL); if (errno == 0 && res >= 0 && res <= 1) {