Browse Source

dselect: Use EOF instead of ERR for fgetc() errors

The macro ERR is a curses one, use EOF which is a stdio value.

Warned-by: gcc-6
Guillem Jover 8 years ago
parent
commit
9497c00cf8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      dselect/method.cc

+ 4 - 2
dselect/method.cc

@@ -159,8 +159,10 @@ falliblesubprocess(struct command *cmd)
   }
   fprintf(stderr,_("Press <enter> to continue.\n"));
   m_output(stderr, _("<standard error>"));
-  do { c= fgetc(stdin); } while ((c == ERR && errno==EINTR) || ((c != '\n') && c != EOF));
-  if ((c == ERR) || (c == EOF))
+  do {
+    c = fgetc(stdin);
+  } while ((c == EOF && errno == EINTR) || (c != '\n' && c != EOF));
+  if (c == EOF)
     ohshite(_("error reading acknowledgement of program failure message"));
   return urqr_fail;
 }