projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5f306f
)
fixed using strtod() by resetting errno to detect overflow/underflow
author
Holger Schemel
<info@artsoft.org>
Sun, 25 Feb 2024 00:18:15 +0000
(
01:18
+0100)
committer
Holger Schemel
<info@artsoft.org>
Sun, 25 Feb 2024 00:19:16 +0000
(
01:19
+0100)
src/game_bd/bd_bdcff.c
patch
|
blob
|
history
diff --git
a/src/game_bd/bd_bdcff.c
b/src/game_bd/bd_bdcff.c
index 8f2ee081e54ffc646a9008e1c3c690820d5d6b37..4c57c14e52988c3ce9c89d040c13aa4a7c74e297 100644
(file)
--- 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)
{