X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_bdcff.c;h=4c57c14e52988c3ce9c89d040c13aa4a7c74e297;hb=402106d4fc637bdda3f3b75f190a6b9335fc99d0;hp=20aba8f946e499a1f5032ff4b919984ebd0d315c;hpb=cea7a60112df6c411e990bf45a6dab0f31de6cc4;p=rocksndiamonds.git diff --git a/src/game_bd/bd_bdcff.c b/src/game_bd/bd_bdcff.c index 20aba8f9..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) { @@ -884,7 +886,7 @@ boolean gd_caveset_load_from_bdcff(const char *contents) /* strip leading and trailing spaces AFTER checking if we are reading a map. map lines might begin or end with spaces */ - g_strstrip(line); + stripString(line); if (reading_highscore) { @@ -1194,12 +1196,12 @@ boolean gd_caveset_load_from_bdcff(const char *contents) object.element = cave->initial_border; object.fill_element = cave->initial_border; - cave->objects = list_prepend(cave->objects, getMemCopy(&object, sizeof(object))); + cave->objects = list_prepend(cave->objects, get_memcpy(&object, sizeof(object))); object.x1 = 19; object.y1 = 0; /* 19, as it is also the border */ - cave->objects = list_prepend(cave->objects, getMemCopy(&object, sizeof(object))); /* another */ + cave->objects = list_prepend(cave->objects, get_memcpy(&object, sizeof(object))); /* another */ } } }