From ef97d579ea8974bfd42b9c5b0d5c9d1983e99448 Mon Sep 17 00:00:00 2001 From: NHOrus Date: Fri, 7 Jul 2017 11:18:02 +0300 Subject: [PATCH] Don't zero stuff twice --- main.c | 3 +-- misc.c | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 5f7cd3f..b788c61 100644 --- a/main.c +++ b/main.c @@ -1014,9 +1014,7 @@ static bool do_command() listobjects(); L2012: - command.verb = 0; game.oldobj = command.obj; - command.obj = 0; L2600: checkhints(); @@ -1047,6 +1045,7 @@ L2600: return (false); if (word_count(input) > 2) { rspeak(TWO_WORDS); + free(input); continue; } if (strcmp(input, "") != 0) diff --git a/misc.c b/misc.c index 0c2a543..784eb73 100644 --- a/misc.c +++ b/misc.c @@ -328,11 +328,12 @@ char* get_input() if (input == NULL) // Got EOF; return with it. return (input); - else if (input[0] == '#') { // Ignore comments. + if (input[0] == '#') { // Ignore comments. free(input); continue; - } else // We have a 'normal' line; leave the loop. - break; + } + // We have a 'normal' line; leave the loop. + break; } // Strip trailing newlines from the input -- 2.31.1