X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=more.c;h=298e1cfb19813657a43afaa6bb0a82f0d2ce9e83;hb=5165fbed639916e0fde15a827241b21981be7934;hp=ffc8206f2bfbb22baa21b85fd8359138b21d6043;hpb=63a862272cc5c0cc8e15c8d95dfb9e8944eb944e;p=oweals%2Fbusybox.git diff --git a/more.c b/more.c index ffc8206f2..298e1cfb1 100644 --- a/more.c +++ b/more.c @@ -25,11 +25,12 @@ * */ -#include "busybox.h" #include #include #include +#include #include +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" @@ -47,15 +48,15 @@ # define getTermSettings(fd,argp) tcgetattr(fd, argp); # endif -FILE *cin; +static FILE *cin; static struct termios initial_settings, new_settings; -void gotsig(int sig) +static void gotsig(int sig) { setTermSettings(fileno(cin), &initial_settings); - fprintf(stdout, "\n"); - exit(TRUE); + putchar('\n'); + exit(EXIT_FAILURE); } #endif /* BB_FEATURE_USE_TERMIOS */ @@ -117,19 +118,19 @@ extern int more_main(int argc, char **argv) please_display_more_prompt = 0; lines = 0; - len = fprintf(stdout, "--More-- "); + len = printf("--More-- "); if (file != stdin) { #if _FILE_OFFSET_BITS == 64 - len += fprintf(stdout, "(%d%% of %lld bytes)", + len += printf("(%d%% of %lld bytes)", #else - len += fprintf(stdout, "(%d%% of %ld bytes)", + len += printf("(%d%% of %ld bytes)", #endif (int) (100 * ((double) ftell(file) / (double) st.st_size)), st.st_size); } - len += fprintf(stdout, "%s", + len += printf("%s", #ifdef BB_FEATURE_USE_TERMIOS "" #else