From bd16520e7c6a7a499a9d4c4a5072721d7d5847d9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 10 Jul 2007 17:28:23 +0000 Subject: [PATCH] (zdon): Simplify. Also gets rid of a compiler warning. --- src/lib/commands/zdon.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib/commands/zdon.c b/src/lib/commands/zdon.c index 9738a849..c6ac37f4 100644 --- a/src/lib/commands/zdon.c +++ b/src/lib/commands/zdon.c @@ -89,18 +89,15 @@ zdon(void) if (player->aborted) return RET_FAIL; - if (!p) { - /* Default response is checking only */ - checking = 1; - } else { - checking = 0; - if (*p == 'n' || *p == 'N') { - wantupd = 0; - } else if (*p == 'y' || *p == 'Y') { + checking = 1; + wantupd = 0; + if (p) { + if (*p == 'y' || *p == 'Y') { + checking = 0; wantupd = 1; - } else { - /* Default response is checking only */ - checking = 1; + } else if (*p == 'n' || *p == 'N') { + checking = 0; + wantupd = 0; } }