X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=actions.c;h=64b5c20aa0f77b3db94e1ce170d80a1e95401637;hp=0aa7d9302decd3ed14d01719a5e8441d299b883d;hb=4a4c113624239b55b176ee23ed8e23c2337d42e2;hpb=51b6b52dc88beeb7873939cadfd61770e69259c3 diff --git a/actions.c b/actions.c index 0aa7d93..64b5c20 100644 --- a/actions.c +++ b/actions.c @@ -419,8 +419,13 @@ static int chain(verb_t verb) switch (game.prop[BEAR]) { case BEAR_DEAD: + // LCOV_EXCL_START + /* Can't be reached as long as the only way for the bear to die + * is from a bridge collapse. Leave in in case this changes, but + * exclude from coverage testing. */ game.fixed[BEAR] = IS_FIXED; break; + // LCOV_EXCL_STOP default: game.fixed[BEAR] = IS_FREE; } @@ -898,7 +903,11 @@ static int listen(void) game.prop[i] < 0) continue; int mi = game.prop[i]; - /* FIXME: Weird magic on object states */ + /* (ESR) Some unpleasant magic on object states here. Ideally + * we'd have liked the bird to be a normal object that we can + * use state_change() on; can't do it, because there are + * actually two different series of per-state birdsounds + * depending on whether player has drunk dragon's blood. */ if (i == BIRD) mi += 3 * game.blooded; long packed_zzword = token_to_packed(game.zzword); @@ -1114,7 +1123,7 @@ static int say(struct command_t *command) { if (command->wd2 > 0) { command->wd1 = command->wd2; - strcpy(command->raw1, command->raw2); + strncpy(command->raw1, command->raw2, LINESIZE - 1); } char word1[TOKLEN + 1]; packed_to_token(command->wd1, word1);