X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fio.c;h=7b4855f6c88048b78890a477733ae6757018bf96;hp=48f2e3876266a13dce90226a111656ba74f280c3;hb=459d6afcbe13be588b29c8bd1fbffb39b13fdee1;hpb=d5b31ded06283b5ae9788716c7753108d23b777c diff --git a/src/io.c b/src/io.c index 48f2e38..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'; }