From: NHOrus Date: Thu, 24 Aug 2017 11:41:21 +0000 (+0300) Subject: Fixed copy-paste errors X-Git-Tag: 1.5~24 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=917af2e7440cd0d274db78c55e1f0cc8c05cde2d;p=open-adventure.git Fixed copy-paste errors --- diff --git a/main.c b/main.c index 6f154c1..0f245a2 100644 --- a/main.c +++ b/main.c @@ -1175,7 +1175,9 @@ Lookup: default: // LCOV_EXCL_LINE BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE } - + if (!is_valid(game)) { + exit(1); + } switch (action(command)) { case GO_TERMINATE: return true; diff --git a/saveresume.c b/saveresume.c index fdb9ffb..cf1dd6c 100644 --- a/saveresume.c +++ b/saveresume.c @@ -141,11 +141,11 @@ bool is_valid(struct game_t valgame) /* Bounds check for locations */ if ( valgame.chloc < -1 || valgame.chloc > NLOCATIONS || - valgame.chloc < -1 || valgame.chloc > NLOCATIONS || + valgame.chloc2 < -1 || valgame.chloc2 > NLOCATIONS || valgame.loc < -1 || valgame.loc > NLOCATIONS || valgame.newloc < -1 || valgame.newloc > NLOCATIONS || valgame.oldloc < -1 || valgame.oldloc > NLOCATIONS || - valgame.oldloc < -1 || valgame.oldloc > NLOCATIONS) { + valgame.oldlc2 < -1 || valgame.oldlc2 > NLOCATIONS) { return false; } /* Bounds check for location arrays */