Преглед на файлове

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 преди 10 години
родител
ревизия
9497c00cf8
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  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;
 }