summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2001-05-16 14:21:09 +0000
committerMatt Kraai2001-05-16 14:21:09 +0000
commit59df6f73988b103f0dcfffeaec10642527336c5e (patch)
treefab28cbdabe79bb98e1cdc99f1fa2b6da599f709
parentbc604a2f417ea290913fedb6807e390e4fc8833e (diff)
downloadbusybox-59df6f73988b103f0dcfffeaec10642527336c5e.zip
busybox-59df6f73988b103f0dcfffeaec10642527336c5e.tar.gz
Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c
by Larry Doolittle.
-rw-r--r--ar.c2
-rw-r--r--archival/ar.c2
-rw-r--r--archival/dpkg_deb.c2
-rw-r--r--basename.c2
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/date.c2
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/expr.c4
-rw-r--r--coreutils/id.c4
-rw-r--r--date.c2
-rw-r--r--dpkg_deb.c2
-rw-r--r--env.c2
-rw-r--r--expr.c4
-rw-r--r--findutils/grep.c2
-rw-r--r--findutils/which.c2
-rw-r--r--grep.c2
-rw-r--r--hostname.c10
-rw-r--r--id.c4
-rw-r--r--lash.c4
-rw-r--r--networking/hostname.c10
-rw-r--r--shell/lash.c4
-rw-r--r--which.c2
22 files changed, 36 insertions, 36 deletions
diff --git a/ar.c b/ar.c
index 4c3d0bb..08cd5c5 100644
--- a/ar.c
+++ b/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;
}
diff --git a/archival/ar.c b/archival/ar.c
index 4c3d0bb..08cd5c5 100644
--- a/archival/ar.c
+++ b/archival/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;
}
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index d088828..17b5476 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -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);
}
diff --git a/basename.c b/basename.c
index e98197d..b83f387 100644
--- a/basename.c
+++ b/basename.c
@@ -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;
}
diff --git a/coreutils/basename.c b/coreutils/basename.c
index e98197d..b83f387 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -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;
}
diff --git a/coreutils/date.c b/coreutils/date.c
index 22a1304..93b078b 100644
--- a/coreutils/date.c
+++ b/coreutils/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;
}
diff --git a/coreutils/env.c b/coreutils/env.c
index 626fc19..8bb690b 100644
--- a/coreutils/env.c
+++ b/coreutils/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;
}
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 4a537bf..d6cc82e 100644
--- a/coreutils/expr.c
+++ b/coreutils/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));
}
diff --git a/coreutils/id.c b/coreutils/id.c
index 3f90d55..85b288c 100644
--- a/coreutils/id.c
+++ b/coreutils/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 {
diff --git a/date.c b/date.c
index 22a1304..93b078b 100644
--- a/date.c
+++ b/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;
}
diff --git a/dpkg_deb.c b/dpkg_deb.c
index d088828..17b5476 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -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);
}
diff --git a/env.c b/env.c
index 626fc19..8bb690b 100644
--- a/env.c
+++ b/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;
}
diff --git a/expr.c b/expr.c
index 4a537bf..d6cc82e 100644
--- a/expr.c
+++ b/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));
}
diff --git a/findutils/grep.c b/findutils/grep.c
index 6d5bd7f..a2fff44 100644
--- a/findutils/grep.c
+++ b/findutils/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);
}
diff --git a/findutils/which.c b/findutils/which.c
index b2acd78..c460ffd 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -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;
}
diff --git a/grep.c b/grep.c
index 6d5bd7f..a2fff44 100644
--- a/grep.c
+++ b/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);
}
diff --git a/hostname.c b/hostname.c
index a6e001d..f4118ea 100644
--- a/hostname.c
+++ b/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);
diff --git a/id.c b/id.c
index 3f90d55..85b288c 100644
--- a/id.c
+++ b/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 {
diff --git a/lash.c b/lash.c
index 89a8fe6..cb17e2d 100644
--- a/lash.c
+++ b/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;
}
diff --git a/networking/hostname.c b/networking/hostname.c
index a6e001d..f4118ea 100644
--- a/networking/hostname.c
+++ b/networking/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);
diff --git a/shell/lash.c b/shell/lash.c
index 89a8fe6..cb17e2d 100644
--- a/shell/lash.c
+++ b/shell/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;
}
diff --git a/which.c b/which.c
index b2acd78..c460ffd 100644
--- a/which.c
+++ b/which.c
@@ -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;
}