projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replaced glib function calls to g_file_get_contents()
[rocksndiamonds.git]
/
src
/
game_bd
/
bd_bdcff.c
diff --git
a/src/game_bd/bd_bdcff.c
b/src/game_bd/bd_bdcff.c
index 1a204a2fb17b26c888d796694fd157aa687258f6..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:
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)
{
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:
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)
{
res = strtod (params[paramindex], NULL);
if (errno == 0 && res >= 0 && res <= 1)
{
@@
-1194,12
+1196,12
@@
boolean gd_caveset_load_from_bdcff(const char *contents)
object.element = cave->initial_border;
object.fill_element = cave->initial_border;
object.element = cave->initial_border;
object.fill_element = cave->initial_border;
- cave->objects = list_prepend(cave->objects, get
MemCo
py(&object, sizeof(object)));
+ cave->objects = list_prepend(cave->objects, get
_memc
py(&object, sizeof(object)));
object.x1 = 19;
object.y1 = 0; /* 19, as it is also the border */
object.x1 = 19;
object.y1 = 0; /* 19, as it is also the border */
- cave->objects = list_prepend(cave->objects, get
MemCo
py(&object, sizeof(object))); /* another */
+ cave->objects = list_prepend(cave->objects, get
_memc
py(&object, sizeof(object))); /* another */
}
}
}
}
}
}