瀏覽代碼

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;
 }