Eliminate calls of the form "fprintf(stdout,". Thanks for the idea to

Vladimir N. Oleynik.
This commit is contained in:
Matt Kraai 2001-01-18 02:57:08 +00:00
parent c9acf8c766
commit 12f417edbd
20 changed files with 102 additions and 108 deletions

View File

@ -147,7 +147,7 @@ static void cmdedit_reset_term(void)
static void clean_up_and_die(int sig)
{
cmdedit_reset_term();
fprintf(stdout, "\n");
printf("\n");
if (sig!=SIGINT)
exit(EXIT_SUCCESS);
}

View File

@ -42,7 +42,7 @@ static Display *print;
static void print_normal(long size, char *filename)
{
fprintf(stdout, "%ld\t%s\n", size, filename);
printf("%ld\t%s\n", size, filename);
}
static void print_summary(long size, char *filename)
@ -165,7 +165,7 @@ int du_main(int argc, char **argv)
return status;
}
/* $Id: du.c,v 1.32 2000/12/12 23:17:26 andersen Exp $ */
/* $Id: du.c,v 1.33 2001/01/18 02:57:08 kraai Exp $ */
/*
Local Variables:
c-file-style: "linux"

View File

@ -76,7 +76,7 @@ int head_main(int argc, char **argv)
}
if (fp) {
if (need_headers) {
fprintf(stdout, "==> %s <==\n", argv[optind]);
printf("==> %s <==\n", argv[optind]);
}
head(len, fp);
if (errno) {
@ -85,7 +85,7 @@ int head_main(int argc, char **argv)
errno = 0;
}
if (optind < argc - 1)
fprintf(stdout, "\n");
putchar('\n');
if (fp != stdin)
fclose(fp);
}

View File

@ -202,7 +202,7 @@ static int my_stat(struct dnode *cur)
static void newline(void)
{
if (column > 0) {
fprintf(stdout, "\n");
putchar('\n');
column = 0;
}
}
@ -229,7 +229,7 @@ static void nexttabstop( void )
n= nexttab - column;
if (n < 1) n= 1;
while (n--) {
fprintf(stdout, " ");
putchar(' ');
column++;
}
}
@ -468,7 +468,7 @@ void showdirs(struct dnode **dn, int ndirs)
for (i=0; i<ndirs; i++) {
if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) {
fprintf(stdout, "\n%s:\n", dn[i]->fullname);
printf("\n%s:\n", dn[i]->fullname);
}
subdnp= list_dir(dn[i]->fullname);
nfiles= countfiles(subdnp);
@ -579,53 +579,53 @@ int list_single(struct dnode *dn)
for (i=0; i<=31; i++) {
switch (list_fmt & (1<<i)) {
case LIST_INO:
fprintf(stdout, "%7ld ", dn->dstat.st_ino);
printf("%7ld ", dn->dstat.st_ino);
column += 8;
break;
case LIST_BLOCKS:
#if _FILE_OFFSET_BITS == 64
fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1);
printf("%4lld ", dn->dstat.st_blocks>>1);
#else
fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1);
printf("%4ld ", dn->dstat.st_blocks>>1);
#endif
column += 5;
break;
case LIST_MODEBITS:
fprintf(stdout, "%10s", (char *)mode_string(dn->dstat.st_mode));
printf("%10s", (char *)mode_string(dn->dstat.st_mode));
column += 10;
break;
case LIST_NLINKS:
fprintf(stdout, "%4d ", dn->dstat.st_nlink);
printf("%4d ", dn->dstat.st_nlink);
column += 10;
break;
case LIST_ID_NAME:
#ifdef BB_FEATURE_LS_USERNAME
my_getpwuid(scratch, dn->dstat.st_uid);
if (*scratch)
fprintf(stdout, "%-8.8s ", scratch);
printf("%-8.8s ", scratch);
else
fprintf(stdout, "%-8d ", dn->dstat.st_uid);
printf("%-8d ", dn->dstat.st_uid);
my_getgrgid(scratch, dn->dstat.st_gid);
if (*scratch)
fprintf(stdout, "%-8.8s", scratch);
printf("%-8.8s", scratch);
else
fprintf(stdout, "%-8d", dn->dstat.st_gid);
printf("%-8d", dn->dstat.st_gid);
column += 17;
break;
#endif
case LIST_ID_NUMERIC:
fprintf(stdout, "%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
column += 17;
break;
case LIST_SIZE:
case LIST_DEV:
if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) {
fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev));
printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev));
} else {
#if _FILE_OFFSET_BITS == 64
fprintf(stdout, "%9lld ", dn->dstat.st_size);
printf("%9lld ", dn->dstat.st_size);
#else
fprintf(stdout, "%9ld ", dn->dstat.st_size);
printf("%9ld ", dn->dstat.st_size);
#endif
}
column += 10;
@ -634,23 +634,23 @@ int list_single(struct dnode *dn)
case LIST_FULLTIME:
case LIST_DATE_TIME:
if (list_fmt & LIST_FULLTIME) {
fprintf(stdout, "%24.24s ", filetime);
printf("%24.24s ", filetime);
column += 25;
break;
}
age = time(NULL) - ttime;
fprintf(stdout, "%6.6s ", filetime+4);
printf("%6.6s ", filetime+4);
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
/* hh:mm if less than 6 months old */
fprintf(stdout, "%5.5s ", filetime+11);
printf("%5.5s ", filetime+11);
} else {
fprintf(stdout, " %4.4s ", filetime+20);
printf(" %4.4s ", filetime+20);
}
column += 13;
break;
#endif
case LIST_FILENAME:
fprintf(stdout, "%s", dn->name);
printf("%s", dn->name);
column += strlen(dn->name);
break;
case LIST_SYMLINK:
@ -658,7 +658,7 @@ int list_single(struct dnode *dn)
len= readlink(dn->fullname, scratch, (sizeof scratch)-1);
if (len > 0) {
scratch[len]= '\0';
fprintf(stdout, " -> %s", scratch);
printf(" -> %s", scratch);
#ifdef BB_FEATURE_LS_FILETYPES
if (!stat(dn->fullname, &info)) {
append = append_char(info.st_mode);
@ -671,7 +671,7 @@ int list_single(struct dnode *dn)
#ifdef BB_FEATURE_LS_FILETYPES
case LIST_FILETYPE:
if (append != '\0') {
fprintf(stdout, "%1c", append);
printf("%1c", append);
column++;
}
break;

4
du.c
View File

@ -42,7 +42,7 @@ static Display *print;
static void print_normal(long size, char *filename)
{
fprintf(stdout, "%ld\t%s\n", size, filename);
printf("%ld\t%s\n", size, filename);
}
static void print_summary(long size, char *filename)
@ -165,7 +165,7 @@ int du_main(int argc, char **argv)
return status;
}
/* $Id: du.c,v 1.32 2000/12/12 23:17:26 andersen Exp $ */
/* $Id: du.c,v 1.33 2001/01/18 02:57:08 kraai Exp $ */
/*
Local Variables:
c-file-style: "linux"

4
find.c
View File

@ -35,7 +35,7 @@ static int dereferenceFlag = FALSE;
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (pattern == NULL)
fprintf(stdout, "%s\n", fileName);
puts(fileName);
else {
char *tmp = strrchr(fileName, '/');
@ -44,7 +44,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
else
tmp++;
if (check_wildcard_match(tmp, pattern) == TRUE)
fprintf(stdout, "%s\n", fileName);
puts(fileName);
}
return (TRUE);
}

View File

@ -35,7 +35,7 @@ static int dereferenceFlag = FALSE;
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (pattern == NULL)
fprintf(stdout, "%s\n", fileName);
puts(fileName);
else {
char *tmp = strrchr(fileName, '/');
@ -44,7 +44,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
else
tmp++;
if (check_wildcard_match(tmp, pattern) == TRUE)
fprintf(stdout, "%s\n", fileName);
puts(fileName);
}
return (TRUE);
}

4
head.c
View File

@ -76,7 +76,7 @@ int head_main(int argc, char **argv)
}
if (fp) {
if (need_headers) {
fprintf(stdout, "==> %s <==\n", argv[optind]);
printf("==> %s <==\n", argv[optind]);
}
head(len, fp);
if (errno) {
@ -85,7 +85,7 @@ int head_main(int argc, char **argv)
errno = 0;
}
if (optind < argc - 1)
fprintf(stdout, "\n");
putchar('\n');
if (fp != stdin)
fclose(fp);
}

46
ls.c
View File

@ -202,7 +202,7 @@ static int my_stat(struct dnode *cur)
static void newline(void)
{
if (column > 0) {
fprintf(stdout, "\n");
putchar('\n');
column = 0;
}
}
@ -229,7 +229,7 @@ static void nexttabstop( void )
n= nexttab - column;
if (n < 1) n= 1;
while (n--) {
fprintf(stdout, " ");
putchar(' ');
column++;
}
}
@ -468,7 +468,7 @@ void showdirs(struct dnode **dn, int ndirs)
for (i=0; i<ndirs; i++) {
if (disp_opts & (DISP_DIRNAME | DISP_RECURSIVE)) {
fprintf(stdout, "\n%s:\n", dn[i]->fullname);
printf("\n%s:\n", dn[i]->fullname);
}
subdnp= list_dir(dn[i]->fullname);
nfiles= countfiles(subdnp);
@ -579,53 +579,53 @@ int list_single(struct dnode *dn)
for (i=0; i<=31; i++) {
switch (list_fmt & (1<<i)) {
case LIST_INO:
fprintf(stdout, "%7ld ", dn->dstat.st_ino);
printf("%7ld ", dn->dstat.st_ino);
column += 8;
break;
case LIST_BLOCKS:
#if _FILE_OFFSET_BITS == 64
fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1);
printf("%4lld ", dn->dstat.st_blocks>>1);
#else
fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1);
printf("%4ld ", dn->dstat.st_blocks>>1);
#endif
column += 5;
break;
case LIST_MODEBITS:
fprintf(stdout, "%10s", (char *)mode_string(dn->dstat.st_mode));
printf("%10s", (char *)mode_string(dn->dstat.st_mode));
column += 10;
break;
case LIST_NLINKS:
fprintf(stdout, "%4d ", dn->dstat.st_nlink);
printf("%4d ", dn->dstat.st_nlink);
column += 10;
break;
case LIST_ID_NAME:
#ifdef BB_FEATURE_LS_USERNAME
my_getpwuid(scratch, dn->dstat.st_uid);
if (*scratch)
fprintf(stdout, "%-8.8s ", scratch);
printf("%-8.8s ", scratch);
else
fprintf(stdout, "%-8d ", dn->dstat.st_uid);
printf("%-8d ", dn->dstat.st_uid);
my_getgrgid(scratch, dn->dstat.st_gid);
if (*scratch)
fprintf(stdout, "%-8.8s", scratch);
printf("%-8.8s", scratch);
else
fprintf(stdout, "%-8d", dn->dstat.st_gid);
printf("%-8d", dn->dstat.st_gid);
column += 17;
break;
#endif
case LIST_ID_NUMERIC:
fprintf(stdout, "%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
column += 17;
break;
case LIST_SIZE:
case LIST_DEV:
if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) {
fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev));
printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev));
} else {
#if _FILE_OFFSET_BITS == 64
fprintf(stdout, "%9lld ", dn->dstat.st_size);
printf("%9lld ", dn->dstat.st_size);
#else
fprintf(stdout, "%9ld ", dn->dstat.st_size);
printf("%9ld ", dn->dstat.st_size);
#endif
}
column += 10;
@ -634,23 +634,23 @@ int list_single(struct dnode *dn)
case LIST_FULLTIME:
case LIST_DATE_TIME:
if (list_fmt & LIST_FULLTIME) {
fprintf(stdout, "%24.24s ", filetime);
printf("%24.24s ", filetime);
column += 25;
break;
}
age = time(NULL) - ttime;
fprintf(stdout, "%6.6s ", filetime+4);
printf("%6.6s ", filetime+4);
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
/* hh:mm if less than 6 months old */
fprintf(stdout, "%5.5s ", filetime+11);
printf("%5.5s ", filetime+11);
} else {
fprintf(stdout, " %4.4s ", filetime+20);
printf(" %4.4s ", filetime+20);
}
column += 13;
break;
#endif
case LIST_FILENAME:
fprintf(stdout, "%s", dn->name);
printf("%s", dn->name);
column += strlen(dn->name);
break;
case LIST_SYMLINK:
@ -658,7 +658,7 @@ int list_single(struct dnode *dn)
len= readlink(dn->fullname, scratch, (sizeof scratch)-1);
if (len > 0) {
scratch[len]= '\0';
fprintf(stdout, " -> %s", scratch);
printf(" -> %s", scratch);
#ifdef BB_FEATURE_LS_FILETYPES
if (!stat(dn->fullname, &info)) {
append = append_char(info.st_mode);
@ -671,7 +671,7 @@ int list_single(struct dnode *dn)
#ifdef BB_FEATURE_LS_FILETYPES
case LIST_FILETYPE:
if (append != '\0') {
fprintf(stdout, "%1c", append);
printf("%1c", append);
column++;
}
break;

12
more.c
View File

@ -54,8 +54,8 @@ static struct termios initial_settings, new_settings;
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 +117,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

View File

@ -332,7 +332,7 @@ static void setConMode()
{
if (G.charmode == CHM_TRY) {
G.charmode = CHM_ON;
fprintf(stdout, "\r\nEntering character mode%s'^]'.\r\n", escapecharis);
printf("\r\nEntering character mode%s'^]'.\r\n", escapecharis);
rawmode();
}
}
@ -340,7 +340,7 @@ static void setConMode()
{
if (G.charmode != CHM_OFF) {
G.charmode = CHM_OFF;
fprintf(stdout, "\r\nEntering line mode%s'^C'.\r\n", escapecharis);
printf("\r\nEntering line mode%s'^C'.\r\n", escapecharis);
cookmode();
}
}

View File

@ -143,8 +143,7 @@ extern int ps_main(int argc, char **argv)
terminal_width = win.ws_col - 1;
#endif
fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid",
"State", "Command");
printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command");
while ((entry = readdir(dir)) != NULL) {
if (!isdigit(*entry->d_name))
continue;
@ -166,8 +165,7 @@ extern int ps_main(int argc, char **argv)
if (file == NULL)
continue;
i = 0;
len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName,
p.state);
len = printf("%5d %-8s %-8s %c ", p.pid, uidName, groupName, p.state);
while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) {
i++;
if (c == '\0')
@ -176,8 +174,8 @@ extern int ps_main(int argc, char **argv)
}
fclose(file);
if (i == 0)
fprintf(stdout, "[%s]", p.cmd);
fprintf(stdout, "\n");
printf("[%s]", p.cmd);
putchar('\n');
}
closedir(dir);
return EXIT_SUCCESS;
@ -240,8 +238,7 @@ extern int ps_main(int argc, char **argv)
#endif
/* Print up a ps listing */
fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid",
"State", "Command");
printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command");
for (i=1; i<pid_array[0] ; i++) {
info.pid = pid_array[i];
@ -257,7 +254,7 @@ extern int ps_main(int argc, char **argv)
if (*groupName == '\0')
sprintf(groupName, "%ld", info.egid);
len = fprintf(stdout, "%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state);
len = printf("%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state);
if (strlen(info.command_line) > 1) {
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)
}
}
*(info.command_line+j) = '\0';
fprintf(stdout, "%s\n", info.command_line);
puts(info.command_line);
} else {
fprintf(stdout, "[%s]\n", info.name);
printf("[%s]\n", info.name);
}
}

View File

@ -51,19 +51,19 @@ extern int uptime_main(int argc, char **argv)
sysinfo(&info);
fprintf(stdout, " %2d:%02d%s up ",
printf(" %2d:%02d%s up ",
current_time->tm_hour%12 ? current_time->tm_hour%12 : 12,
current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am");
updays = (int) info.uptime / (60*60*24);
if (updays)
fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : "");
printf("%d day%s, ", updays, (updays != 1) ? "s" : "");
upminutes = (int) info.uptime / 60;
uphours = (upminutes / 60) % 24;
upminutes %= 60;
if(uphours)
fprintf(stdout, "%2d:%02d, ", uphours, upminutes);
printf("%2d:%02d, ", uphours, upminutes);
else
fprintf(stdout, "%d min, ", upminutes);
printf("%d min, ", upminutes);
printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n",
LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]),

19
ps.c
View File

@ -143,8 +143,7 @@ extern int ps_main(int argc, char **argv)
terminal_width = win.ws_col - 1;
#endif
fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid",
"State", "Command");
printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command");
while ((entry = readdir(dir)) != NULL) {
if (!isdigit(*entry->d_name))
continue;
@ -166,8 +165,7 @@ extern int ps_main(int argc, char **argv)
if (file == NULL)
continue;
i = 0;
len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName,
p.state);
len = printf("%5d %-8s %-8s %c ", p.pid, uidName, groupName, p.state);
while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) {
i++;
if (c == '\0')
@ -176,8 +174,8 @@ extern int ps_main(int argc, char **argv)
}
fclose(file);
if (i == 0)
fprintf(stdout, "[%s]", p.cmd);
fprintf(stdout, "\n");
printf("[%s]", p.cmd);
putchar('\n');
}
closedir(dir);
return EXIT_SUCCESS;
@ -240,8 +238,7 @@ extern int ps_main(int argc, char **argv)
#endif
/* Print up a ps listing */
fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid",
"State", "Command");
printf("%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", "State", "Command");
for (i=1; i<pid_array[0] ; i++) {
info.pid = pid_array[i];
@ -257,7 +254,7 @@ extern int ps_main(int argc, char **argv)
if (*groupName == '\0')
sprintf(groupName, "%ld", info.egid);
len = fprintf(stdout, "%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state);
len = printf("%5d %-8s %-8s %c ", info.pid, uidName, groupName, info.state);
if (strlen(info.command_line) > 1) {
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)
}
}
*(info.command_line+j) = '\0';
fprintf(stdout, "%s\n", info.command_line);
puts(info.command_line);
} else {
fprintf(stdout, "[%s]\n", info.name);
printf("[%s]\n", info.name);
}
}

View File

@ -126,7 +126,7 @@ int rdate_main(int argc, char **argv)
perror_msg_and_die("Could not set time of day");
}
if (printdate) {
fprintf(stdout, "%s", ctime(&time));
printf("%s", ctime(&time));
}
return EXIT_SUCCESS;

View File

@ -147,7 +147,7 @@ static void cmdedit_reset_term(void)
static void clean_up_and_die(int sig)
{
cmdedit_reset_term();
fprintf(stdout, "\n");
printf("\n");
if (sig!=SIGINT)
exit(EXIT_SUCCESS);
}

View File

@ -332,7 +332,7 @@ static void setConMode()
{
if (G.charmode == CHM_TRY) {
G.charmode = CHM_ON;
fprintf(stdout, "\r\nEntering character mode%s'^]'.\r\n", escapecharis);
printf("\r\nEntering character mode%s'^]'.\r\n", escapecharis);
rawmode();
}
}
@ -340,7 +340,7 @@ static void setConMode()
{
if (G.charmode != CHM_OFF) {
G.charmode = CHM_OFF;
fprintf(stdout, "\r\nEntering line mode%s'^C'.\r\n", escapecharis);
printf("\r\nEntering line mode%s'^C'.\r\n", escapecharis);
cookmode();
}
}

View File

@ -51,19 +51,19 @@ extern int uptime_main(int argc, char **argv)
sysinfo(&info);
fprintf(stdout, " %2d:%02d%s up ",
printf(" %2d:%02d%s up ",
current_time->tm_hour%12 ? current_time->tm_hour%12 : 12,
current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am");
updays = (int) info.uptime / (60*60*24);
if (updays)
fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : "");
printf("%d day%s, ", updays, (updays != 1) ? "s" : "");
upminutes = (int) info.uptime / 60;
uphours = (upminutes / 60) % 24;
upminutes %= 60;
if(uphours)
fprintf(stdout, "%2d:%02d, ", uphours, upminutes);
printf("%2d:%02d, ", uphours, upminutes);
else
fprintf(stdout, "%d min, ", upminutes);
printf("%d min, ", upminutes);
printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n",
LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]),

View File

@ -54,8 +54,8 @@ static struct termios initial_settings, new_settings;
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 +117,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

View File

@ -126,7 +126,7 @@ int rdate_main(int argc, char **argv)
perror_msg_and_die("Could not set time of day");
}
if (printdate) {
fprintf(stdout, "%s", ctime(&time));
printf("%s", ctime(&time));
}
return EXIT_SUCCESS;