From 8f9899ab8727d8a2173afe6a622e97c5cff386fc Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Mon, 28 Aug 2017 18:09:59 +0100 Subject: [PATCH] read_switch_multiword.c: siglongjmp(3) removes need for `else'. --- sbr/read_switch_multiword.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sbr/read_switch_multiword.c b/sbr/read_switch_multiword.c index 047d1474..67c5f33e 100644 --- a/sbr/read_switch_multiword.c +++ b/sbr/read_switch_multiword.c @@ -50,7 +50,7 @@ read_switch_multiword (const char *prompt, const struct swit *ansp) * then just return. */ - else if (ferror(stdin)) { + if (ferror(stdin)) { if (errno == EINTR) { clearerr(stdin); continue; @@ -58,14 +58,11 @@ read_switch_multiword (const char *prompt, const struct swit *ansp) fprintf(stderr, "\nError %s during read\n", strerror(errno)); siglongjmp (sigenv, 1); - } else { - /* - * Just for completeness's sake ... - */ - - fprintf(stderr, "\nUnknown problem in getchar()\n"); - siglongjmp (sigenv, 1); } + + /* Just for completeness's sake... */ + fprintf(stderr, "\nUnknown problem in getchar()\n"); + siglongjmp(sigenv, 1); } if (cp < &ansbuf[sizeof ansbuf - 1]) *cp++ = i; -- 2.56.0