From: Jason S. Ninneman Date: Sat, 1 Jul 2017 18:03:20 +0000 (-0700) Subject: Never write the input prompt to log files. X-Git-Tag: takebird~138 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F183%2Fhead;p=open-adventure.git Never write the input prompt to log files. --- diff --git a/advent.h b/advent.h index e638e84..9de79f0 100644 --- a/advent.h +++ b/advent.h @@ -187,7 +187,7 @@ extern void wordclear(token_t *); extern void speak(const char*, ...); extern void pspeak(vocab_t, enum speaktype, int, ...); extern void rspeak(vocab_t, ...); -extern void echo_input(FILE*, char*, char*); +extern void echo_input(FILE*, const char*, const char*); extern int word_count(char*); extern char* get_input(void); extern bool silent_yes(void); diff --git a/misc.c b/misc.c index 5eb1fa2..ac22ae0 100644 --- a/misc.c +++ b/misc.c @@ -295,7 +295,7 @@ void rspeak(vocab_t i, ...) va_end(ap); } -void echo_input(FILE* destination, char* input_prompt, char* input) +void echo_input(FILE* destination, const char* input_prompt, const char* input) { size_t len = strlen(input_prompt) + strlen(input) + 1; char* prompt_and_input = (char*) xmalloc(len); @@ -354,7 +354,7 @@ char* get_input() echo_input(stdout, input_prompt, input); if (logfp) - echo_input(logfp, input_prompt, input); + echo_input(logfp, "", input); return (input); }