diff options
author | Matt Kraai <kraai@debian.org> | 2001-01-18 02:57:08 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-01-18 02:57:08 +0000 |
commit | 12f417edbd21b322a8eaa8feb0ab238f13fa83c6 (patch) | |
tree | 06f9de2e4c7d33d29a448fb1c42ed1beafe18e6e | |
parent | c9acf8c766a9a2cc00449db5dea506d7663ad26b (diff) | |
download | busybox-w32-12f417edbd21b322a8eaa8feb0ab238f13fa83c6.tar.gz busybox-w32-12f417edbd21b322a8eaa8feb0ab238f13fa83c6.tar.bz2 busybox-w32-12f417edbd21b322a8eaa8feb0ab238f13fa83c6.zip |
Eliminate calls of the form "fprintf(stdout,". Thanks for the idea to
Vladimir N. Oleynik.
-rw-r--r-- | cmdedit.c | 2 | ||||
-rw-r--r-- | coreutils/du.c | 4 | ||||
-rw-r--r-- | coreutils/head.c | 4 | ||||
-rw-r--r-- | coreutils/ls.c | 46 | ||||
-rw-r--r-- | du.c | 4 | ||||
-rw-r--r-- | find.c | 4 | ||||
-rw-r--r-- | findutils/find.c | 4 | ||||
-rw-r--r-- | head.c | 4 | ||||
-rw-r--r-- | ls.c | 46 | ||||
-rw-r--r-- | more.c | 12 | ||||
-rw-r--r-- | networking/telnet.c | 4 | ||||
-rw-r--r-- | procps/ps.c | 19 | ||||
-rw-r--r-- | procps/uptime.c | 8 | ||||
-rw-r--r-- | ps.c | 19 | ||||
-rw-r--r-- | rdate.c | 2 | ||||
-rw-r--r-- | shell/cmdedit.c | 2 | ||||
-rw-r--r-- | telnet.c | 4 | ||||
-rw-r--r-- | uptime.c | 8 | ||||
-rw-r--r-- | util-linux/more.c | 12 | ||||
-rw-r--r-- | util-linux/rdate.c | 2 |
20 files changed, 102 insertions, 108 deletions
@@ -147,7 +147,7 @@ static void cmdedit_reset_term(void) | |||
147 | static void clean_up_and_die(int sig) | 147 | static void clean_up_and_die(int sig) |
148 | { | 148 | { |
149 | cmdedit_reset_term(); | 149 | cmdedit_reset_term(); |
150 | fprintf(stdout, "\n"); | 150 | printf("\n"); |
151 | if (sig!=SIGINT) | 151 | if (sig!=SIGINT) |
152 | exit(EXIT_SUCCESS); | 152 | exit(EXIT_SUCCESS); |
153 | } | 153 | } |
diff --git a/coreutils/du.c b/coreutils/du.c index a04dba6d3..8628732d8 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -42,7 +42,7 @@ static Display *print; | |||
42 | 42 | ||
43 | static void print_normal(long size, char *filename) | 43 | static void print_normal(long size, char *filename) |
44 | { | 44 | { |
45 | fprintf(stdout, "%ld\t%s\n", size, filename); | 45 | printf("%ld\t%s\n", size, filename); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void print_summary(long size, char *filename) | 48 | static void print_summary(long size, char *filename) |
@@ -165,7 +165,7 @@ int du_main(int argc, char **argv) | |||
165 | return status; | 165 | return status; |
166 | } | 166 | } |
167 | 167 | ||
168 | /* $Id: du.c,v 1.32 2000/12/12 23:17:26 andersen Exp $ */ | 168 | /* $Id: du.c,v 1.33 2001/01/18 02:57:08 kraai Exp $ */ |
169 | /* | 169 | /* |
170 | Local Variables: | 170 | Local Variables: |
171 | c-file-style: "linux" | 171 | c-file-style: "linux" |
diff --git a/coreutils/head.c b/coreutils/head.c index 6e05eded5..a0ca453de 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -76,7 +76,7 @@ int head_main(int argc, char **argv) | |||
76 | } | 76 | } |
77 | if (fp) { | 77 | if (fp) { |
78 | if (need_headers) { | 78 | if (need_headers) { |
79 | fprintf(stdout, "==> %s <==\n", argv[optind]); | 79 | printf("==> %s <==\n", argv[optind]); |
80 | } | 80 | } |
81 | head(len, fp); | 81 | head(len, fp); |
82 | if (errno) { | 82 | if (errno) { |
@@ -85,7 +85,7 @@ int head_main(int argc, char **argv) | |||
85 | errno = 0; | 85 | errno = 0; |
86 | } | 86 | } |
87 | if (optind < argc - 1) | 87 | if (optind < argc - 1) |
88 | fprintf(stdout, "\n"); | 88 | putchar('\n'); |
89 | if (fp != stdin) | 89 | if (fp != stdin) |
90 | fclose(fp); | 90 | fclose(fp); |
91 | } | 91 | } |
diff --git a/coreutils/ls.c b/coreutils/ls.c index e44bd9b93..fa3e5424d 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -202,7 +202,7 @@ static int my_stat(struct dnode *cur) | |||
202 | static void newline(void) | 202 | static void newline(void) |
203 | { | 203 | { |
204 | if (column > 0) { | 204 | if (column > 0) { |
205 | fprintf(stdout, "\n"); | 205 | putchar('\n'); |
206 | column = 0; | 206 | column = 0; |
207 | } | 207 | } |
208 | } | 208 | } |
@@ -229,7 +229,7 @@ static void nexttabstop( void ) | |||
229 | n= nexttab - column; | 229 | n= nexttab - column; |
230 | if (n < 1) n= 1; | 230 | if (n < 1) n= 1; |
231 | while (n--) { | 231 | while (n--) { |
232 | fprintf(stdout, " "); | 232 | putchar(' '); |
233 | column++; | 233 | column++; |
234 | } | 234 | } |
235 | } | 235 | } |
@@ -468,7 +468,7 @@ void showdirs(struct dnode **dn, int ndirs) | |||
468 | 468 | ||
469 | for (i=0; i<ndirs; i++) { | 469 | for (i=0; i<ndirs; i++) { |
470 | if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) { | 470 | if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) { |
471 | fprintf(stdout, "\n%s:\n", dn[i]->fullname); | 471 | printf("\n%s:\n", dn[i]->fullname); |
472 | } | 472 | } |
473 | subdnp= list_dir(dn[i]->fullname); | 473 | subdnp= list_dir(dn[i]->fullname); |
474 | nfiles= countfiles(subdnp); | 474 | nfiles= countfiles(subdnp); |
@@ -579,53 +579,53 @@ int list_single(struct dnode *dn) | |||
579 | for (i=0; i<=31; i++) { | 579 | for (i=0; i<=31; i++) { |
580 | switch (list_fmt & (1<<i)) { | 580 | switch (list_fmt & (1<<i)) { |
581 | case LIST_INO: | 581 | case LIST_INO: |
582 | fprintf(stdout, "%7ld ", dn->dstat.st_ino); | 582 | printf("%7ld ", dn->dstat.st_ino); |
583 | column += 8; | 583 | column += 8; |
584 | break; | 584 | break; |
585 | case LIST_BLOCKS: | 585 | case LIST_BLOCKS: |
586 | #if _FILE_OFFSET_BITS == 64 | 586 | #if _FILE_OFFSET_BITS == 64 |
587 | fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1); | 587 | printf("%4lld ", dn->dstat.st_blocks>>1); |
588 | #else | 588 | #else |
589 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); | 589 | printf("%4ld ", dn->dstat.st_blocks>>1); |
590 | #endif | 590 | #endif |
591 | column += 5; | 591 | column += 5; |
592 | break; | 592 | break; |
593 | case LIST_MODEBITS: | 593 | case LIST_MODEBITS: |
594 | fprintf(stdout, "%10s", (char *)mode_string(dn->dstat.st_mode)); | 594 | printf("%10s", (char *)mode_string(dn->dstat.st_mode)); |
595 | column += 10; | 595 | column += 10; |
596 | break; | 596 | break; |
597 | case LIST_NLINKS: | 597 | case LIST_NLINKS: |
598 | fprintf(stdout, "%4d ", dn->dstat.st_nlink); | 598 | printf("%4d ", dn->dstat.st_nlink); |
599 | column += 10; | 599 | column += 10; |
600 | break; | 600 | break; |
601 | case LIST_ID_NAME: | 601 | case LIST_ID_NAME: |
602 | #ifdef BB_FEATURE_LS_USERNAME | 602 | #ifdef BB_FEATURE_LS_USERNAME |
603 | my_getpwuid(scratch, dn->dstat.st_uid); | 603 | my_getpwuid(scratch, dn->dstat.st_uid); |
604 | if (*scratch) | 604 | if (*scratch) |
605 | fprintf(stdout, "%-8.8s ", scratch); | 605 | printf("%-8.8s ", scratch); |
606 | else | 606 | else |
607 | fprintf(stdout, "%-8d ", dn->dstat.st_uid); | 607 | printf("%-8d ", dn->dstat.st_uid); |
608 | my_getgrgid(scratch, dn->dstat.st_gid); | 608 | my_getgrgid(scratch, dn->dstat.st_gid); |
609 | if (*scratch) | 609 | if (*scratch) |
610 | fprintf(stdout, "%-8.8s", scratch); | 610 | printf("%-8.8s", scratch); |
611 | else | 611 | else |
612 | fprintf(stdout, "%-8d", dn->dstat.st_gid); | 612 | printf("%-8d", dn->dstat.st_gid); |
613 | column += 17; | 613 | column += 17; |
614 | break; | 614 | break; |
615 | #endif | 615 | #endif |
616 | case LIST_ID_NUMERIC: | 616 | case LIST_ID_NUMERIC: |
617 | fprintf(stdout, "%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid); | 617 | printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid); |
618 | column += 17; | 618 | column += 17; |
619 | break; | 619 | break; |
620 | case LIST_SIZE: | 620 | case LIST_SIZE: |
621 | case LIST_DEV: | 621 | case LIST_DEV: |
622 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { | 622 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { |
623 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); | 623 | printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); |
624 | } else { | 624 | } else { |
625 | #if _FILE_OFFSET_BITS == 64 | 625 | #if _FILE_OFFSET_BITS == 64 |
626 | fprintf(stdout, "%9lld ", dn->dstat.st_size); | 626 | printf("%9lld ", dn->dstat.st_size); |
627 | #else | 627 | #else |
628 | fprintf(stdout, "%9ld ", dn->dstat.st_size); | 628 | printf("%9ld ", dn->dstat.st_size); |
629 | #endif | 629 | #endif |
630 | } | 630 | } |
631 | column += 10; | 631 | column += 10; |
@@ -634,23 +634,23 @@ int list_single(struct dnode *dn) | |||
634 | case LIST_FULLTIME: | 634 | case LIST_FULLTIME: |
635 | case LIST_DATE_TIME: | 635 | case LIST_DATE_TIME: |
636 | if (list_fmt & LIST_FULLTIME) { | 636 | if (list_fmt & LIST_FULLTIME) { |
637 | fprintf(stdout, "%24.24s ", filetime); | 637 | printf("%24.24s ", filetime); |
638 | column += 25; | 638 | column += 25; |
639 | break; | 639 | break; |
640 | } | 640 | } |
641 | age = time(NULL) - ttime; | 641 | age = time(NULL) - ttime; |
642 | fprintf(stdout, "%6.6s ", filetime+4); | 642 | printf("%6.6s ", filetime+4); |
643 | if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) { | 643 | if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) { |
644 | /* hh:mm if less than 6 months old */ | 644 | /* hh:mm if less than 6 months old */ |
645 | fprintf(stdout, "%5.5s ", filetime+11); | 645 | printf("%5.5s ", filetime+11); |
646 | } else { | 646 | } else { |
647 | fprintf(stdout, " %4.4s ", filetime+20); | 647 | printf(" %4.4s ", filetime+20); |
648 | } | 648 | } |
649 | column += 13; | 649 | column += 13; |
650 | break; | 650 | break; |
651 | #endif | 651 | #endif |
652 | case LIST_FILENAME: | 652 | case LIST_FILENAME: |
653 | fprintf(stdout, "%s", dn->name); | 653 | printf("%s", dn->name); |
654 | column += strlen(dn->name); | 654 | column += strlen(dn->name); |
655 | break; | 655 | break; |
656 | case LIST_SYMLINK: | 656 | case LIST_SYMLINK: |
@@ -658,7 +658,7 @@ int list_single(struct dnode *dn) | |||
658 | len= readlink(dn->fullname, scratch, (sizeof scratch)-1); | 658 | len= readlink(dn->fullname, scratch, (sizeof scratch)-1); |
659 | if (len > 0) { | 659 | if (len > 0) { |
660 | scratch[len]= '\0'; | 660 | scratch[len]= '\0'; |
661 | fprintf(stdout, " -> %s", scratch); | 661 | printf(" -> %s", scratch); |
662 | #ifdef BB_FEATURE_LS_FILETYPES | 662 | #ifdef BB_FEATURE_LS_FILETYPES |
663 | if (!stat(dn->fullname, &info)) { | 663 | if (!stat(dn->fullname, &info)) { |
664 | append = append_char(info.st_mode); | 664 | append = append_char(info.st_mode); |
@@ -671,7 +671,7 @@ int list_single(struct dnode *dn) | |||
671 | #ifdef BB_FEATURE_LS_FILETYPES | 671 | #ifdef BB_FEATURE_LS_FILETYPES |
672 | case LIST_FILETYPE: | 672 | case LIST_FILETYPE: |
673 | if (append != '\0') { | 673 | if (append != '\0') { |
674 | fprintf(stdout, "%1c", append); | 674 | printf("%1c", append); |
675 | column++; | 675 | column++; |
676 | } | 676 | } |
677 | break; | 677 | break; |
@@ -42,7 +42,7 @@ static Display *print; | |||
42 | 42 | ||
43 | static void print_normal(long size, char *filename) | 43 | static void print_normal(long size, char *filename) |
44 | { | 44 | { |
45 | fprintf(stdout, "%ld\t%s\n", size, filename); | 45 | printf("%ld\t%s\n", size, filename); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void print_summary(long size, char *filename) | 48 | static void print_summary(long size, char *filename) |
@@ -165,7 +165,7 @@ int du_main(int argc, char **argv) | |||
165 | return status; | 165 | return status; |
166 | } | 166 | } |
167 | 167 | ||
168 | /* $Id: du.c,v 1.32 2000/12/12 23:17:26 andersen Exp $ */ | 168 | /* $Id: du.c,v 1.33 2001/01/18 02:57:08 kraai Exp $ */ |
169 | /* | 169 | /* |
170 | Local Variables: | 170 | Local Variables: |
171 | c-file-style: "linux" | 171 | c-file-style: "linux" |
@@ -35,7 +35,7 @@ static int dereferenceFlag = FALSE; | |||
35 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | 35 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) |
36 | { | 36 | { |
37 | if (pattern == NULL) | 37 | if (pattern == NULL) |
38 | fprintf(stdout, "%s\n", fileName); | 38 | puts(fileName); |
39 | else { | 39 | else { |
40 | char *tmp = strrchr(fileName, '/'); | 40 | char *tmp = strrchr(fileName, '/'); |
41 | 41 | ||
@@ -44,7 +44,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | |||
44 | else | 44 | else |
45 | tmp++; | 45 | tmp++; |
46 | if (check_wildcard_match(tmp, pattern) == TRUE) | 46 | if (check_wildcard_match(tmp, pattern) == TRUE) |
47 | fprintf(stdout, "%s\n", fileName); | 47 | puts(fileName); |
48 | } | 48 | } |
49 | return (TRUE); | 49 | return (TRUE); |
50 | } | 50 | } |
diff --git a/findutils/find.c b/findutils/find.c index c82b509b6..32d7db7ab 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -35,7 +35,7 @@ static int dereferenceFlag = FALSE; | |||
35 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | 35 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) |
36 | { | 36 | { |
37 | if (pattern == NULL) | 37 | if (pattern == NULL) |
38 | fprintf(stdout, "%s\n", fileName); | 38 | puts(fileName); |
39 | else { | 39 | else { |
40 | char *tmp = strrchr(fileName, '/'); | 40 | char *tmp = strrchr(fileName, '/'); |
41 | 41 | ||
@@ -44,7 +44,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | |||
44 | else | 44 | else |
45 | tmp++; | 45 | tmp++; |
46 | if (check_wildcard_match(tmp, pattern) == TRUE) | 46 | if (check_wildcard_match(tmp, pattern) == TRUE) |
47 | fprintf(stdout, "%s\n", fileName); | 47 | puts(fileName); |
48 | } | 48 | } |
49 | return (TRUE); | 49 | return (TRUE); |
50 | } | 50 | } |
@@ -76,7 +76,7 @@ int head_main(int argc, char **argv) | |||
76 | } | 76 | } |
77 | if (fp) { | 77 | if (fp) { |
78 | if (need_headers) { | 78 | if (need_headers) { |
79 | fprintf(stdout, "==> %s <==\n", argv[optind]); | 79 | printf("==> %s <==\n", argv[optind]); |
80 | } | 80 | } |
81 | head(len, fp); | 81 | head(len, fp); |
82 | if (errno) { | 82 | if (errno) { |
@@ -85,7 +85,7 @@ int head_main(int argc, char **argv) | |||
85 | errno = 0; | 85 | errno = 0; |
86 | } | 86 | } |
87 | if (optind < argc - 1) | 87 | if (optind < argc - 1) |
88 | fprintf(stdout, "\n"); | 88 | putchar('\n'); |
89 | if (fp != stdin) | 89 | if (fp != stdin) |
90 | fclose(fp); | 90 | fclose(fp); |
91 | } | 91 | } |
@@ -202,7 +202,7 @@ static int my_stat(struct dnode *cur) | |||
202 | static void newline(void) | 202 | static void newline(void) |
203 | { | 203 | { |
204 | if (column > 0) { | 204 | if (column > 0) { |
205 | fprintf(stdout, "\n"); | 205 | putchar('\n'); |
206 | column = 0; | 206 | column = 0; |
207 | } | 207 | } |
208 | } | 208 | } |
@@ -229,7 +229,7 @@ static void nexttabstop( void ) | |||
229 | n= nexttab - column; | 229 | n= nexttab - column; |
230 | if (n < 1) n= 1; | 230 | if (n < 1) n= 1; |
231 | while (n--) { | 231 | while (n--) { |
232 | fprintf(stdout, " "); | 232 | putchar(' '); |
233 | column++; | 233 | column++; |
234 | } | 234 | } |
235 | } | 235 | } |
@@ -468,7 +468,7 @@ void showdirs(struct dnode **dn, int ndirs) | |||
468 | 468 | ||
469 | for (i=0; i<ndirs; i++) { | 469 | for (i=0; i<ndirs; i++) { |
470 | if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) { | 470 | if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) { |
471 | fprintf(stdout, "\n%s:\n", dn[i]->fullname); | 471 | printf("\n%s:\n", dn[i]->fullname); |
472 | } | 472 | } |
473 | subdnp= list_dir(dn[i]->fullname); | 473 | subdnp= list_dir(dn[i]->fullname); |
474 | nfiles= countfiles(subdnp); | 474 | nfiles= countfiles(subdnp); |
@@ -579,53 +579,53 @@ int list_single(struct dnode *dn) | |||
579 | for (i=0; i<=31; i++) { | 579 | for (i=0; i<=31; i++) { |
580 | switch (list_fmt & (1<<i)) { | 580 | switch (list_fmt & (1<<i)) { |
581 | case LIST_INO: | 581 | case LIST_INO: |
582 | fprintf(stdout, "%7ld ", dn->dstat.st_ino); | 582 | printf("%7ld ", dn->dstat.st_ino); |
583 | column += 8; | 583 | column += 8; |
584 | break; | 584 | break; |
585 | case LIST_BLOCKS: | 585 | case LIST_BLOCKS: |
586 | #if _FILE_OFFSET_BITS == 64 | 586 | #if _FILE_OFFSET_BITS == 64 |
587 | fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1); | 587 | printf("%4lld ", dn->dstat.st_blocks>>1); |
588 | #else | 588 | #else |
589 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); | 589 | printf("%4ld ", dn->dstat.st_blocks>>1); |
590 | #endif | 590 | #endif |
591 | column += 5; | 591 | column += 5; |
592 | break; | 592 | break; |
593 | case LIST_MODEBITS: | 593 | case LIST_MODEBITS: |
594 | fprintf(stdout, "%10s", (char *)mode_string(dn->dstat.st_mode)); | 594 | printf("%10s", (char *)mode_string(dn->dstat.st_mode)); |
595 | column += 10; | 595 | column += 10; |
596 | break; | 596 | break; |
597 | case LIST_NLINKS: | 597 | case LIST_NLINKS: |
598 | fprintf(stdout, "%4d ", dn->dstat.st_nlink); | 598 | printf("%4d ", dn->dstat.st_nlink); |
599 | column += 10; | 599 | column += 10; |
600 | break; | 600 | break; |
601 | case LIST_ID_NAME: | 601 | case LIST_ID_NAME: |
602 | #ifdef BB_FEATURE_LS_USERNAME | 602 | #ifdef BB_FEATURE_LS_USERNAME |
603 | my_getpwuid(scratch, dn->dstat.st_uid); | 603 | my_getpwuid(scratch, dn->dstat.st_uid); |
604 | if (*scratch) | 604 | if (*scratch) |
605 | fprintf(stdout, "%-8.8s ", scratch); | 605 | printf("%-8.8s ", scratch); |
606 | else | 606 | else |
607 | fprintf(stdout, "%-8d ", dn->dstat.st_uid); | 607 | printf("%-8d ", dn->dstat.st_uid); |
608 | my_getgrgid(scratch, dn->dstat.st_gid); | 608 | my_getgrgid(scratch, dn->dstat.st_gid); |
609 | if (*scratch) | 609 | if (*scratch) |
610 | fprintf(stdout, "%-8.8s", scratch); | 610 | printf("%-8.8s", scratch); |
611 | else | 611 | else |
612 | fprintf(stdout, "%-8d", dn->dstat.st_gid); | 612 | printf("%-8d", dn->dstat.st_gid); |
613 | column += 17; | 613 | column += 17; |
614 | break; | 614 | break; |
615 | #endif | 615 | #endif |
616 | case LIST_ID_NUMERIC: | 616 | case LIST_ID_NUMERIC: |
617 | fprintf(stdout, "%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid); | 617 | printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid); |
618 | column += 17; | 618 | column += 17; |
619 | break; | 619 | break; |
620 | case LIST_SIZE: | 620 | case LIST_SIZE: |
621 | case LIST_DEV: | 621 | case LIST_DEV: |
622 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { | 622 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { |
623 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); | 623 | printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); |
624 | } else { | 624 | } else { |
625 | #if _FILE_OFFSET_BITS == 64 | 625 | #if _FILE_OFFSET_BITS == 64 |
626 | fprintf(stdout, "%9lld ", dn->dstat.st_size); | 626 | printf("%9lld ", dn->dstat.st_size); |
627 | #else | 627 | #else |
628 | fprintf(stdout, "%9ld ", dn->dstat.st_size); | 628 | printf("%9ld ", dn->dstat.st_size); |
629 | #endif | 629 | #endif |
630 | } | 630 | } |
631 | column += 10; | 631 | column += 10; |
@@ -634,23 +634,23 @@ int list_single(struct dnode *dn) | |||
634 | case LIST_FULLTIME: | 634 | case LIST_FULLTIME: |
635 | case LIST_DATE_TIME: | 635 | case LIST_DATE_TIME: |
636 | if (list_fmt & LIST_FULLTIME) { | 636 | if (list_fmt & LIST_FULLTIME) { |
637 | fprintf(stdout, "%24.24s ", filetime); | 637 | printf("%24.24s ", filetime); |
638 | column += 25; | 638 | column += 25; |
639 | break; | 639 | break; |
640 | } | 640 | } |
641 | age = time(NULL) - ttime; | 641 | age = time(NULL) - ttime; |
642 | fprintf(stdout, "%6.6s ", filetime+4); | 642 | printf("%6.6s ", filetime+4); |
643 | if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) { | 643 | if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) { |
644 | /* hh:mm if less than 6 months old */ | 644 | /* hh:mm if less than 6 months old */ |
645 | fprintf(stdout, "%5.5s ", filetime+11); | 645 | printf("%5.5s ", filetime+11); |
646 | } else { | 646 | } else { |
647 | fprintf(stdout, " %4.4s ", filetime+20); | 647 | printf(" %4.4s ", filetime+20); |
648 | } | 648 | } |
649 | column += 13; | 649 | column += 13; |
650 | break; | 650 | break; |
651 | #endif | 651 | #endif |
652 | case LIST_FILENAME: | 652 | case LIST_FILENAME: |
653 | fprintf(stdout, "%s", dn->name); | 653 | printf("%s", dn->name); |
654 | column += strlen(dn->name); | 654 | column += strlen(dn->name); |
655 | break; | 655 | break; |
656 | case LIST_SYMLINK: | 656 | case LIST_SYMLINK: |
@@ -658,7 +658,7 @@ int list_single(struct dnode *dn) | |||
658 | len= readlink(dn->fullname, scratch, (sizeof scratch)-1); | 658 | len= readlink(dn->fullname, scratch, (sizeof scratch)-1); |
659 | if (len > 0) { | 659 | if (len > 0) { |
660 | scratch[len]= '\0'; | 660 | scratch[len]= '\0'; |
661 | fprintf(stdout, " -> %s", scratch); | 661 | printf(" -> %s", scratch); |
662 | #ifdef BB_FEATURE_LS_FILETYPES | 662 | #ifdef BB_FEATURE_LS_FILETYPES |
663 | if (!stat(dn->fullname, &info)) { | 663 | if (!stat(dn->fullname, &info)) { |
664 | append = append_char(info.st_mode); | 664 | append = append_char(info.st_mode); |
@@ -671,7 +671,7 @@ int list_single(struct dnode *dn) | |||
671 | #ifdef BB_FEATURE_LS_FILETYPES | 671 | #ifdef BB_FEATURE_LS_FILETYPES |
672 | case LIST_FILETYPE: | 672 | case LIST_FILETYPE: |
673 | if (append != '\0') { | 673 | if (append != '\0') { |
674 | fprintf(stdout, "%1c", append); | 674 | printf("%1c", append); |
675 | column++; | 675 | column++; |
676 | } | 676 | } |
677 | break; | 677 | break; |
@@ -54,8 +54,8 @@ static struct termios initial_settings, new_settings; | |||
54 | static void gotsig(int sig) | 54 | static void gotsig(int sig) |
55 | { | 55 | { |
56 | setTermSettings(fileno(cin), &initial_settings); | 56 | setTermSettings(fileno(cin), &initial_settings); |
57 | fprintf(stdout, "\n"); | 57 | putchar('\n'); |
58 | exit(TRUE); | 58 | exit(EXIT_FAILURE); |
59 | } | 59 | } |
60 | #endif /* BB_FEATURE_USE_TERMIOS */ | 60 | #endif /* BB_FEATURE_USE_TERMIOS */ |
61 | 61 | ||
@@ -117,19 +117,19 @@ extern int more_main(int argc, char **argv) | |||
117 | 117 | ||
118 | please_display_more_prompt = 0; | 118 | please_display_more_prompt = 0; |
119 | lines = 0; | 119 | lines = 0; |
120 | len = fprintf(stdout, "--More-- "); | 120 | len = printf("--More-- "); |
121 | if (file != stdin) { | 121 | if (file != stdin) { |
122 | #if _FILE_OFFSET_BITS == 64 | 122 | #if _FILE_OFFSET_BITS == 64 |
123 | len += fprintf(stdout, "(%d%% of %lld bytes)", | 123 | len += printf("(%d%% of %lld bytes)", |
124 | #else | 124 | #else |
125 | len += fprintf(stdout, "(%d%% of %ld bytes)", | 125 | len += printf("(%d%% of %ld bytes)", |
126 | #endif | 126 | #endif |
127 | (int) (100 * | 127 | (int) (100 * |
128 | ((double) ftell(file) / | 128 | ((double) ftell(file) / |
129 | (double) st.st_size)), | 129 | (double) st.st_size)), |
130 | st.st_size); | 130 | st.st_size); |
131 | } | 131 | } |
132 | len += fprintf(stdout, "%s", | 132 | len += printf("%s", |
133 | #ifdef BB_FEATURE_USE_TERMIOS | 133 | #ifdef BB_FEATURE_USE_TERMIOS |
134 | "" | 134 | "" |
135 | #else | 135 | #else |
diff --git a/networking/telnet.c b/networking/telnet.c index fff8c06b5..54f25c4bc 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -332,7 +332,7 @@ static void setConMode() | |||
332 | { | 332 | { |
333 | if (G.charmode == CHM_TRY) { | 333 | if (G.charmode == CHM_TRY) { |
334 | G.charmode = CHM_ON; | 334 | G.charmode = CHM_ON; |
335 | fprintf(stdout, "\r\nEntering character mode%s'^]'.\r\n", escapecharis); | 335 | printf("\r\nEntering character mode%s'^]'.\r\n", escapecharis); |
336 | rawmode(); | 336 | rawmode(); |
337 | } | 337 | } |
338 | } | 338 | } |
@@ -340,7 +340,7 @@ static void setConMode() | |||
340 | { | 340 | { |
341 | if (G.charmode != CHM_OFF) { | 341 | if (G.charmode != CHM_OFF) { |
342 | G.charmode = CHM_OFF; | 342 | G.charmode = CHM_OFF; |
343 | fprintf(stdout, "\r\nEntering line mode%s'^C'.\r\n", escapecharis); | 343 | printf("\r\nEntering line mode%s'^C'.\r\n", escapecharis); |
344 | cookmode(); | 344 | cookmode(); |
345 | } | 345 | } |
346 | } | 346 | } |
diff --git a/procps/ps.c b/procps/ps.c index 2b41a495f..ec63bb548 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -143,8 +143,7 @@ extern int ps_main(int argc, char **argv) | |||
143 | terminal_width = win.ws_col - 1; | 143 | terminal_width = win.ws_col - 1; |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", | 146 | printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command"); |
147 | "State", "Command"); | ||
148 | while ((entry = readdir(dir)) != NULL) { | 147 | while ((entry = readdir(dir)) != NULL) { |
149 | if (!isdigit(*entry->d_name)) | 148 | if (!isdigit(*entry->d_name)) |
150 | continue; | 149 | continue; |
@@ -166,8 +165,7 @@ extern int ps_main(int argc, char **argv) | |||
166 | if (file == NULL) | 165 | if (file == NULL) |
167 | continue; | 166 | continue; |
168 | i = 0; | 167 | i = 0; |
169 | len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName, | 168 | len = printf("%5d %-8s %-8s %c ", p.pid, uidName, groupName, p.state); |
170 | p.state); | ||
171 | while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) { | 169 | while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) { |
172 | i++; | 170 | i++; |
173 | if (c == '\0') | 171 | if (c == '\0') |
@@ -176,8 +174,8 @@ extern int ps_main(int argc, char **argv) | |||
176 | } | 174 | } |
177 | fclose(file); | 175 | fclose(file); |
178 | if (i == 0) | 176 | if (i == 0) |
179 | fprintf(stdout, "[%s]", p.cmd); | 177 | printf("[%s]", p.cmd); |
180 | fprintf(stdout, "\n"); | 178 | putchar('\n'); |
181 | } | 179 | } |
182 | closedir(dir); | 180 | closedir(dir); |
183 | return EXIT_SUCCESS; | 181 | return EXIT_SUCCESS; |
@@ -240,8 +238,7 @@ extern int ps_main(int argc, char **argv) | |||
240 | #endif | 238 | #endif |
241 | 239 | ||
242 | /* Print up a ps listing */ | 240 | /* Print up a ps listing */ |
243 | fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", | 241 | printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command"); |
244 | "State", "Command"); | ||
245 | 242 | ||
246 | for (i=1; i<pid_array[0] ; i++) { | 243 | for (i=1; i<pid_array[0] ; i++) { |
247 | info.pid = pid_array[i]; | 244 | info.pid = pid_array[i]; |
@@ -257,7 +254,7 @@ extern int ps_main(int argc, char **argv) | |||
257 | if (*groupName == '\0') | 254 | if (*groupName == '\0') |
258 | sprintf(groupName, "%ld", info.egid); | 255 | sprintf(groupName, "%ld", info.egid); |
259 | 256 | ||
260 | len = fprintf(stdout, "%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state); | 257 | len = printf("%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state); |
261 | 258 | ||
262 | if (strlen(info.command_line) > 1) { | 259 | if (strlen(info.command_line) > 1) { |
263 | for( j=0; j<(sizeof(info.command_line)-1) && j < (terminal_width-len); j++) { | 260 | for( j=0; j<(sizeof(info.command_line)-1) && j < (terminal_width-len); j++) { |
@@ -266,9 +263,9 @@ extern int ps_main(int argc, char **argv) | |||
266 | } | 263 | } |
267 | } | 264 | } |
268 | *(info.command_line+j) = '\0'; | 265 | *(info.command_line+j) = '\0'; |
269 | fprintf(stdout, "%s\n", info.command_line); | 266 | puts(info.command_line); |
270 | } else { | 267 | } else { |
271 | fprintf(stdout, "[%s]\n", info.name); | 268 | printf("[%s]\n", info.name); |
272 | } | 269 | } |
273 | } | 270 | } |
274 | 271 | ||
diff --git a/procps/uptime.c b/procps/uptime.c index 159f24baa..fb3d347c3 100644 --- a/procps/uptime.c +++ b/procps/uptime.c | |||
@@ -51,19 +51,19 @@ extern int uptime_main(int argc, char **argv) | |||
51 | 51 | ||
52 | sysinfo(&info); | 52 | sysinfo(&info); |
53 | 53 | ||
54 | fprintf(stdout, " %2d:%02d%s up ", | 54 | printf(" %2d:%02d%s up ", |
55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, | 55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, |
56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); | 56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); |
57 | updays = (int) info.uptime / (60*60*24); | 57 | updays = (int) info.uptime / (60*60*24); |
58 | if (updays) | 58 | if (updays) |
59 | fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : ""); | 59 | printf("%d day%s, ", updays, (updays != 1) ? "s" : ""); |
60 | upminutes = (int) info.uptime / 60; | 60 | upminutes = (int) info.uptime / 60; |
61 | uphours = (upminutes / 60) % 24; | 61 | uphours = (upminutes / 60) % 24; |
62 | upminutes %= 60; | 62 | upminutes %= 60; |
63 | if(uphours) | 63 | if(uphours) |
64 | fprintf(stdout, "%2d:%02d, ", uphours, upminutes); | 64 | printf("%2d:%02d, ", uphours, upminutes); |
65 | else | 65 | else |
66 | fprintf(stdout, "%d min, ", upminutes); | 66 | printf("%d min, ", upminutes); |
67 | 67 | ||
68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", | 68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", |
69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), | 69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), |
@@ -143,8 +143,7 @@ extern int ps_main(int argc, char **argv) | |||
143 | terminal_width = win.ws_col - 1; | 143 | terminal_width = win.ws_col - 1; |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", | 146 | printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command"); |
147 | "State", "Command"); | ||
148 | while ((entry = readdir(dir)) != NULL) { | 147 | while ((entry = readdir(dir)) != NULL) { |
149 | if (!isdigit(*entry->d_name)) | 148 | if (!isdigit(*entry->d_name)) |
150 | continue; | 149 | continue; |
@@ -166,8 +165,7 @@ extern int ps_main(int argc, char **argv) | |||
166 | if (file == NULL) | 165 | if (file == NULL) |
167 | continue; | 166 | continue; |
168 | i = 0; | 167 | i = 0; |
169 | len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName, | 168 | len = printf("%5d %-8s %-8s %c ", p.pid, uidName, groupName, p.state); |
170 | p.state); | ||
171 | while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) { | 169 | while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) { |
172 | i++; | 170 | i++; |
173 | if (c == '\0') | 171 | if (c == '\0') |
@@ -176,8 +174,8 @@ extern int ps_main(int argc, char **argv) | |||
176 | } | 174 | } |
177 | fclose(file); | 175 | fclose(file); |
178 | if (i == 0) | 176 | if (i == 0) |
179 | fprintf(stdout, "[%s]", p.cmd); | 177 | printf("[%s]", p.cmd); |
180 | fprintf(stdout, "\n"); | 178 | putchar('\n'); |
181 | } | 179 | } |
182 | closedir(dir); | 180 | closedir(dir); |
183 | return EXIT_SUCCESS; | 181 | return EXIT_SUCCESS; |
@@ -240,8 +238,7 @@ extern int ps_main(int argc, char **argv) | |||
240 | #endif | 238 | #endif |
241 | 239 | ||
242 | /* Print up a ps listing */ | 240 | /* Print up a ps listing */ |
243 | fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", | 241 | printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command"); |
244 | "State", "Command"); | ||
245 | 242 | ||
246 | for (i=1; i<pid_array[0] ; i++) { | 243 | for (i=1; i<pid_array[0] ; i++) { |
247 | info.pid = pid_array[i]; | 244 | info.pid = pid_array[i]; |
@@ -257,7 +254,7 @@ extern int ps_main(int argc, char **argv) | |||
257 | if (*groupName == '\0') | 254 | if (*groupName == '\0') |
258 | sprintf(groupName, "%ld", info.egid); | 255 | sprintf(groupName, "%ld", info.egid); |
259 | 256 | ||
260 | len = fprintf(stdout, "%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state); | 257 | len = printf("%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state); |
261 | 258 | ||
262 | if (strlen(info.command_line) > 1) { | 259 | if (strlen(info.command_line) > 1) { |
263 | for( j=0; j<(sizeof(info.command_line)-1) && j < (terminal_width-len); j++) { | 260 | for( j=0; j<(sizeof(info.command_line)-1) && j < (terminal_width-len); j++) { |
@@ -266,9 +263,9 @@ extern int ps_main(int argc, char **argv) | |||
266 | } | 263 | } |
267 | } | 264 | } |
268 | *(info.command_line+j) = '\0'; | 265 | *(info.command_line+j) = '\0'; |
269 | fprintf(stdout, "%s\n", info.command_line); | 266 | puts(info.command_line); |
270 | } else { | 267 | } else { |
271 | fprintf(stdout, "[%s]\n", info.name); | 268 | printf("[%s]\n", info.name); |
272 | } | 269 | } |
273 | } | 270 | } |
274 | 271 | ||
@@ -126,7 +126,7 @@ int rdate_main(int argc, char **argv) | |||
126 | perror_msg_and_die("Could not set time of day"); | 126 | perror_msg_and_die("Could not set time of day"); |
127 | } | 127 | } |
128 | if (printdate) { | 128 | if (printdate) { |
129 | fprintf(stdout, "%s", ctime(&time)); | 129 | printf("%s", ctime(&time)); |
130 | } | 130 | } |
131 | 131 | ||
132 | return EXIT_SUCCESS; | 132 | return EXIT_SUCCESS; |
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 0765ca3ce..722a36a50 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -147,7 +147,7 @@ static void cmdedit_reset_term(void) | |||
147 | static void clean_up_and_die(int sig) | 147 | static void clean_up_and_die(int sig) |
148 | { | 148 | { |
149 | cmdedit_reset_term(); | 149 | cmdedit_reset_term(); |
150 | fprintf(stdout, "\n"); | 150 | printf("\n"); |
151 | if (sig!=SIGINT) | 151 | if (sig!=SIGINT) |
152 | exit(EXIT_SUCCESS); | 152 | exit(EXIT_SUCCESS); |
153 | } | 153 | } |
@@ -332,7 +332,7 @@ static void setConMode() | |||
332 | { | 332 | { |
333 | if (G.charmode == CHM_TRY) { | 333 | if (G.charmode == CHM_TRY) { |
334 | G.charmode = CHM_ON; | 334 | G.charmode = CHM_ON; |
335 | fprintf(stdout, "\r\nEntering character mode%s'^]'.\r\n", escapecharis); | 335 | printf("\r\nEntering character mode%s'^]'.\r\n", escapecharis); |
336 | rawmode(); | 336 | rawmode(); |
337 | } | 337 | } |
338 | } | 338 | } |
@@ -340,7 +340,7 @@ static void setConMode() | |||
340 | { | 340 | { |
341 | if (G.charmode != CHM_OFF) { | 341 | if (G.charmode != CHM_OFF) { |
342 | G.charmode = CHM_OFF; | 342 | G.charmode = CHM_OFF; |
343 | fprintf(stdout, "\r\nEntering line mode%s'^C'.\r\n", escapecharis); | 343 | printf("\r\nEntering line mode%s'^C'.\r\n", escapecharis); |
344 | cookmode(); | 344 | cookmode(); |
345 | } | 345 | } |
346 | } | 346 | } |
@@ -51,19 +51,19 @@ extern int uptime_main(int argc, char **argv) | |||
51 | 51 | ||
52 | sysinfo(&info); | 52 | sysinfo(&info); |
53 | 53 | ||
54 | fprintf(stdout, " %2d:%02d%s up ", | 54 | printf(" %2d:%02d%s up ", |
55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, | 55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, |
56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); | 56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); |
57 | updays = (int) info.uptime / (60*60*24); | 57 | updays = (int) info.uptime / (60*60*24); |
58 | if (updays) | 58 | if (updays) |
59 | fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : ""); | 59 | printf("%d day%s, ", updays, (updays != 1) ? "s" : ""); |
60 | upminutes = (int) info.uptime / 60; | 60 | upminutes = (int) info.uptime / 60; |
61 | uphours = (upminutes / 60) % 24; | 61 | uphours = (upminutes / 60) % 24; |
62 | upminutes %= 60; | 62 | upminutes %= 60; |
63 | if(uphours) | 63 | if(uphours) |
64 | fprintf(stdout, "%2d:%02d, ", uphours, upminutes); | 64 | printf("%2d:%02d, ", uphours, upminutes); |
65 | else | 65 | else |
66 | fprintf(stdout, "%d min, ", upminutes); | 66 | printf("%d min, ", upminutes); |
67 | 67 | ||
68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", | 68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", |
69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), | 69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), |
diff --git a/util-linux/more.c b/util-linux/more.c index 9310cf930..538708caa 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -54,8 +54,8 @@ static struct termios initial_settings, new_settings; | |||
54 | static void gotsig(int sig) | 54 | static void gotsig(int sig) |
55 | { | 55 | { |
56 | setTermSettings(fileno(cin), &initial_settings); | 56 | setTermSettings(fileno(cin), &initial_settings); |
57 | fprintf(stdout, "\n"); | 57 | putchar('\n'); |
58 | exit(TRUE); | 58 | exit(EXIT_FAILURE); |
59 | } | 59 | } |
60 | #endif /* BB_FEATURE_USE_TERMIOS */ | 60 | #endif /* BB_FEATURE_USE_TERMIOS */ |
61 | 61 | ||
@@ -117,19 +117,19 @@ extern int more_main(int argc, char **argv) | |||
117 | 117 | ||
118 | please_display_more_prompt = 0; | 118 | please_display_more_prompt = 0; |
119 | lines = 0; | 119 | lines = 0; |
120 | len = fprintf(stdout, "--More-- "); | 120 | len = printf("--More-- "); |
121 | if (file != stdin) { | 121 | if (file != stdin) { |
122 | #if _FILE_OFFSET_BITS == 64 | 122 | #if _FILE_OFFSET_BITS == 64 |
123 | len += fprintf(stdout, "(%d%% of %lld bytes)", | 123 | len += printf("(%d%% of %lld bytes)", |
124 | #else | 124 | #else |
125 | len += fprintf(stdout, "(%d%% of %ld bytes)", | 125 | len += printf("(%d%% of %ld bytes)", |
126 | #endif | 126 | #endif |
127 | (int) (100 * | 127 | (int) (100 * |
128 | ((double) ftell(file) / | 128 | ((double) ftell(file) / |
129 | (double) st.st_size)), | 129 | (double) st.st_size)), |
130 | st.st_size); | 130 | st.st_size); |
131 | } | 131 | } |
132 | len += fprintf(stdout, "%s", | 132 | len += printf("%s", |
133 | #ifdef BB_FEATURE_USE_TERMIOS | 133 | #ifdef BB_FEATURE_USE_TERMIOS |
134 | "" | 134 | "" |
135 | #else | 135 | #else |
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 03f7f2de3..bb5392746 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -126,7 +126,7 @@ int rdate_main(int argc, char **argv) | |||
126 | perror_msg_and_die("Could not set time of day"); | 126 | perror_msg_and_die("Could not set time of day"); |
127 | } | 127 | } |
128 | if (printdate) { | 128 | if (printdate) { |
129 | fprintf(stdout, "%s", ctime(&time)); | 129 | printf("%s", ctime(&time)); |
130 | } | 130 | } |
131 | 131 | ||
132 | return EXIT_SUCCESS; | 132 | return EXIT_SUCCESS; |