X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fio.c;h=7b4855f6c88048b78890a477733ae6757018bf96;hp=b513f26af4efe625d0cddb238ba06491de6057b7;hb=459d6afcbe13be588b29c8bd1fbffb39b13fdee1;hpb=8700dc6a521fe201815aad02cf05f7f4c297c305 diff --git a/src/io.c b/src/io.c index b513f26..7b4855f 100644 --- a/src/io.c +++ b/src/io.c @@ -27,6 +27,8 @@ static void outro(void) (void)endwin(); putchar('\n'); } + if (logfp) + fclose(logfp); } void iostart(void) @@ -203,6 +205,8 @@ void cgetline(char *line, int max) } else { fgets(line, max, stdin); } + if (logfp) + fputs(line, logfp); line[strlen(line)-1] = '\0'; } @@ -303,7 +307,7 @@ void highvideo (void) } } -void commandhook(char *cmd, int before) { +void commandhook(char *cmd, bool before) { } /* @@ -430,7 +434,7 @@ void makechart(void) void setpassword(void) { if (!(game.options & OPTION_CURSES)) { - while (TRUE) { + for (;;) { scan(); strcpy(game.passwd, citem); chew();