]> diplodocus.org Git - nmh/commitdiff
read_switch_multiword.c: siglongjmp(3) removes need for `else'.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 17:09:59 +0000 (18:09 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 17:09:59 +0000 (18:09 +0100)
sbr/read_switch_multiword.c

index 047d147481154ff2fb6d608cfe88cfcc48e77d14..67c5f33e2b5e9685c5d4d44ef007b6e29a441783 100644 (file)
@@ -50,7 +50,7 @@ read_switch_multiword (const char *prompt, const struct swit *ansp)
                 * then just return.
                 */
 
                 * then just return.
                 */
 
-               else if (ferror(stdin)) {
+               if (ferror(stdin)) {
                    if (errno == EINTR) {
                        clearerr(stdin);
                        continue;
                    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);
                    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;
            }
            if (cp < &ansbuf[sizeof ansbuf - 1])
                *cp++ = i;