getty: do not emit bogus error message on EOF
[oweals/busybox.git] / util-linux / more.c
index 9ac4dd8e3860df563ecabcc393aede1745f7b87b..55694e434936cb097fd958efe6632a3163d4aca7 100644 (file)
@@ -22,7 +22,7 @@ struct globals {
        int cin_fileno;
        struct termios initial_settings;
        struct termios new_settings;
-};
+} FIX_ALIASING;
 #define G (*(struct globals*)bb_common_bufsiz1)
 #define INIT_G() ((void)0)
 #define initial_settings (G.initial_settings)
@@ -110,11 +110,11 @@ int more_main(int argc UNUSED_PARAM, char **argv)
                        if (input != 'r' && please_display_more_prompt) {
                                len = printf("--More-- ");
                                if (st.st_size > 0) {
-                                       len += printf("(%d%% of %"OFF_FMT"d bytes)",
+                                       len += printf("(%u%% of %"OFF_FMT"u bytes)",
                                                (int) (ftello(file)*100 / st.st_size),
                                                st.st_size);
                                }
-                               fflush(stdout);
+                               fflush_all();
 
                                /*
                                 * We've just displayed the "--More--" prompt, so now we need
@@ -189,7 +189,7 @@ int more_main(int argc UNUSED_PARAM, char **argv)
                        putchar(c);
                }
                fclose(file);
-               fflush(stdout);
+               fflush_all();
        } while (*argv && *++argv);
  end:
        setTermSettings(cin_fileno, &initial_settings);