Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c
by Larry Doolittle.
This commit is contained in:
parent
bc604a2f41
commit
59df6f7398
2
ar.c
2
ar.c
@ -119,7 +119,7 @@ extern int ar_main(int argc, char **argv)
|
||||
(int) ar_extract_list->size, time_string(ar_extract_list->mtime));
|
||||
}
|
||||
if ((funct & display) || (funct & verbose)){
|
||||
printf("%s\n", ar_extract_list->name);
|
||||
puts(ar_extract_list->name);
|
||||
}
|
||||
ar_extract_list = ar_extract_list->next;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ extern int ar_main(int argc, char **argv)
|
||||
(int) ar_extract_list->size, time_string(ar_extract_list->mtime));
|
||||
}
|
||||
if ((funct & display) || (funct & verbose)){
|
||||
printf("%s\n", ar_extract_list->name);
|
||||
puts(ar_extract_list->name);
|
||||
}
|
||||
ar_extract_list = ar_extract_list->next;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ extern int dpkg_deb_main(int argc, char **argv)
|
||||
field_length = strlen(field);
|
||||
field_start += (field_length + 1);
|
||||
if (strstr(field, argument) == field) {
|
||||
printf("%s\n", field + strlen(argument) + 2);
|
||||
puts(field + strlen(argument) + 2);
|
||||
}
|
||||
free(field);
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ extern int basename_main(int argc, char **argv)
|
||||
if (m>=n && strncmp(s+m-n, *argv, n)==0)
|
||||
s[m-n] = '\0';
|
||||
}
|
||||
printf("%s\n", s);
|
||||
puts(s);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ extern int basename_main(int argc, char **argv)
|
||||
if (m>=n && strncmp(s+m-n, *argv, n)==0)
|
||||
s[m-n] = '\0';
|
||||
}
|
||||
printf("%s\n", s);
|
||||
puts(s);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ int date_main(int argc, char **argv)
|
||||
/* Print OUTPUT (after ALL that!) */
|
||||
t_buff = xmalloc(201);
|
||||
strftime(t_buff, 200, date_fmt, &tm_time);
|
||||
printf("%s\n", t_buff);
|
||||
puts(t_buff);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ extern int env_main(int argc, char** argv)
|
||||
perror_msg_and_die("%s", *argv);
|
||||
}
|
||||
for (ep = environ; *ep; ep++)
|
||||
printf("%s\n", *ep);
|
||||
puts(*ep);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -89,8 +89,8 @@ int expr_main (int argc, char **argv)
|
||||
|
||||
if (v->type == integer)
|
||||
printf ("%d\n", v->u.i);
|
||||
else
|
||||
printf ("%s\n", v->u.s);
|
||||
else
|
||||
puts (v->u.s);
|
||||
|
||||
exit (null (v));
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ extern int id_main(int argc, char **argv)
|
||||
|
||||
if (no_group) {
|
||||
if(name_not_number && user)
|
||||
printf("%s\n",user);
|
||||
puts(user);
|
||||
else
|
||||
printf("%ld\n", pwnam);
|
||||
} else if (no_user) {
|
||||
if(name_not_number && group)
|
||||
printf("%s\n", group);
|
||||
puts(group);
|
||||
else
|
||||
printf("%ld\n", grnam);
|
||||
} else {
|
||||
|
2
date.c
2
date.c
@ -241,7 +241,7 @@ int date_main(int argc, char **argv)
|
||||
/* Print OUTPUT (after ALL that!) */
|
||||
t_buff = xmalloc(201);
|
||||
strftime(t_buff, 200, date_fmt, &tm_time);
|
||||
printf("%s\n", t_buff);
|
||||
puts(t_buff);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ extern int dpkg_deb_main(int argc, char **argv)
|
||||
field_length = strlen(field);
|
||||
field_start += (field_length + 1);
|
||||
if (strstr(field, argument) == field) {
|
||||
printf("%s\n", field + strlen(argument) + 2);
|
||||
puts(field + strlen(argument) + 2);
|
||||
}
|
||||
free(field);
|
||||
}
|
||||
|
2
env.c
2
env.c
@ -66,7 +66,7 @@ extern int env_main(int argc, char** argv)
|
||||
perror_msg_and_die("%s", *argv);
|
||||
}
|
||||
for (ep = environ; *ep; ep++)
|
||||
printf("%s\n", *ep);
|
||||
puts(*ep);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
4
expr.c
4
expr.c
@ -89,8 +89,8 @@ int expr_main (int argc, char **argv)
|
||||
|
||||
if (v->type == integer)
|
||||
printf ("%d\n", v->u.i);
|
||||
else
|
||||
printf ("%s\n", v->u.s);
|
||||
else
|
||||
puts (v->u.s);
|
||||
|
||||
exit (null (v));
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ static void grep_file(FILE *file)
|
||||
}
|
||||
/* just grep -l: print just the filename, but only if we grepped the line in the file */
|
||||
else if (print_files_with_matches && !print_match_counts && nmatches > 0) {
|
||||
printf("%s\n", cur_file);
|
||||
puts(cur_file);
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ extern int which_main(int argc, char **argv)
|
||||
if (stat (buf, &filestat) == 0
|
||||
&& filestat.st_mode & S_IXUSR)
|
||||
{
|
||||
printf ("%s\n", buf);
|
||||
puts(buf);
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
2
grep.c
2
grep.c
@ -170,7 +170,7 @@ static void grep_file(FILE *file)
|
||||
}
|
||||
/* just grep -l: print just the filename, but only if we grepped the line in the file */
|
||||
else if (print_files_with_matches && !print_match_counts && nmatches > 0) {
|
||||
printf("%s\n", cur_file);
|
||||
puts(cur_file);
|
||||
}
|
||||
|
||||
|
||||
|
10
hostname.c
10
hostname.c
@ -1,6 +1,6 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $
|
||||
* $Id: hostname.c,v 1.27 2001/05/16 14:21:09 kraai Exp $
|
||||
* Mini hostname implementation for busybox
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -112,19 +112,19 @@ int hostname_main(int argc, char **argv)
|
||||
if (!s)
|
||||
s = buf;
|
||||
*s = 0;
|
||||
printf("%s\n", buf);
|
||||
puts(buf);
|
||||
} else if (opt_domain) {
|
||||
s = strchr(buf, '.');
|
||||
printf("%s\n", (s ? s + 1 : ""));
|
||||
puts(s ? s + 1 : "");
|
||||
} else if (opt_ip) {
|
||||
h = gethostbyname(buf);
|
||||
if (!h) {
|
||||
printf("Host not found\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("%s\n", inet_ntoa(*(struct in_addr *) (h->h_addr)));
|
||||
puts(inet_ntoa(*(struct in_addr *) (h->h_addr)));
|
||||
} else {
|
||||
printf("%s\n", buf);
|
||||
puts(buf);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
|
4
id.c
4
id.c
@ -79,12 +79,12 @@ extern int id_main(int argc, char **argv)
|
||||
|
||||
if (no_group) {
|
||||
if(name_not_number && user)
|
||||
printf("%s\n",user);
|
||||
puts(user);
|
||||
else
|
||||
printf("%ld\n", pwnam);
|
||||
} else if (no_user) {
|
||||
if(name_not_number && group)
|
||||
printf("%s\n", group);
|
||||
puts(group);
|
||||
else
|
||||
printf("%ld\n", grnam);
|
||||
} else {
|
||||
|
4
lash.c
4
lash.c
@ -416,7 +416,7 @@ static int builtin_pwd(struct child_prog *dummy)
|
||||
cwd = xgetcwd((char *)cwd);
|
||||
if (!cwd)
|
||||
cwd = unknown;
|
||||
printf( "%s\n", cwd);
|
||||
puts(cwd);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ static int builtin_export(struct child_prog *child)
|
||||
if (v == NULL) {
|
||||
char **e;
|
||||
for (e = environ; *e; e++) {
|
||||
printf( "%s\n", *e);
|
||||
puts(*e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $
|
||||
* $Id: hostname.c,v 1.27 2001/05/16 14:21:09 kraai Exp $
|
||||
* Mini hostname implementation for busybox
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -112,19 +112,19 @@ int hostname_main(int argc, char **argv)
|
||||
if (!s)
|
||||
s = buf;
|
||||
*s = 0;
|
||||
printf("%s\n", buf);
|
||||
puts(buf);
|
||||
} else if (opt_domain) {
|
||||
s = strchr(buf, '.');
|
||||
printf("%s\n", (s ? s + 1 : ""));
|
||||
puts(s ? s + 1 : "");
|
||||
} else if (opt_ip) {
|
||||
h = gethostbyname(buf);
|
||||
if (!h) {
|
||||
printf("Host not found\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("%s\n", inet_ntoa(*(struct in_addr *) (h->h_addr)));
|
||||
puts(inet_ntoa(*(struct in_addr *) (h->h_addr)));
|
||||
} else {
|
||||
printf("%s\n", buf);
|
||||
puts(buf);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
|
@ -416,7 +416,7 @@ static int builtin_pwd(struct child_prog *dummy)
|
||||
cwd = xgetcwd((char *)cwd);
|
||||
if (!cwd)
|
||||
cwd = unknown;
|
||||
printf( "%s\n", cwd);
|
||||
puts(cwd);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ static int builtin_export(struct child_prog *child)
|
||||
if (v == NULL) {
|
||||
char **e;
|
||||
for (e = environ; *e; e++) {
|
||||
printf( "%s\n", *e);
|
||||
puts(*e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user