vspeak(objects[msg].inventory, ap);
break;
case look:
- vspeak(objects[msg].longs[skip], ap);
+ vspeak(objects[msg].descriptions[skip], ap);
break;
case hear:
vspeak(objects[msg].sounds[skip], ap);
case study:
vspeak(objects[msg].texts[skip], ap);
break;
+ case change:
+ vspeak(objects[msg].changes[skip], ap);
+ break;
}
va_end(ap);
}
input = NULL;
size_t n = 0;
if (isatty(0))
+ // LCOV_EXCL_START
+ // Should be unreachable in tests, as they will use a non-interactive shell.
printf("%s", input_prompt);
+ // LCOV_EXCL_STOP
IGNORE(getline(&input, &n, stdin));
}
speak(question);
reply = get_input();
- if (reply == NULL) {
- linenoiseFree(reply);
- exit(EXIT_SUCCESS);
- }
+ if (reply == NULL) {
+ // LCOV_EXCL_START
+ // Should be unreachable. Reply should never be NULL
+ linenoiseFree(reply);
+ exit(EXIT_SUCCESS);
+ // LCOV_EXCL_STOP
+ }
char* firstword = (char*) xmalloc(strlen(reply)+1);
sscanf(reply, "%s", firstword);
long setbit(long bit)
/* Returns 2**bit for use in constructing bit-masks. */
{
- return (1 << bit);
+ return (1L << bit);
}
bool tstbit(long mask, int bit)