Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c
authorMatt Kraai <kraai@debian.org>
Wed, 16 May 2001 14:21:09 +0000 (14:21 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 16 May 2001 14:21:09 +0000 (14:21 -0000)
by Larry Doolittle.

22 files changed:
ar.c
archival/ar.c
archival/dpkg_deb.c
basename.c
coreutils/basename.c
coreutils/date.c
coreutils/env.c
coreutils/expr.c
coreutils/id.c
date.c
dpkg_deb.c
env.c
expr.c
findutils/grep.c
findutils/which.c
grep.c
hostname.c
id.c
lash.c
networking/hostname.c
shell/lash.c
which.c

diff --git a/ar.c b/ar.c
index 4c3d0bbd5110e6c5974fcb6b9f65a883c5e1b266..08cd5c50125cdd6649c8f338f61e48a0a6c812c8 100644 (file)
--- 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;
        }
index 4c3d0bbd5110e6c5974fcb6b9f65a883c5e1b266..08cd5c50125cdd6649c8f338f61e48a0a6c812c8 100644 (file)
@@ -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;
        }
index d088828857b86730f1ebf9233374300f93a9a8fc..17b5476d0ddefc1f4ab7d1114a788b1af1cc1887 100644 (file)
@@ -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);
                }
index e98197dd420241c3c356b4a47efaac4e1937e102..b83f387c29c70725fb69b22efee4e9a38d6133b7 100644 (file)
@@ -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;
 }
index e98197dd420241c3c356b4a47efaac4e1937e102..b83f387c29c70725fb69b22efee4e9a38d6133b7 100644 (file)
@@ -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;
 }
index 22a1304d5aae8718394805c97ccf527cf95514ed..93b078b45a01ce1ff9ca09317212605bd0646ba1 100644 (file)
@@ -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;
 }
index 626fc1952a6d976aad3b590086ed60942af294e4..8bb690b72e5134554e81e6d06e65b222965339ab 100644 (file)
@@ -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;
 }
 
index 4a537bf33077d5490b6f3793a25d0a5f5ab0541e..d6cc82e3ee5cae81419ded7334fe66ed535a5314 100644 (file)
@@ -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));
 }
index 3f90d55f63b2321043e729c68721b390841ab309..85b288c0c2dc53d1717c2c9615450eac1099c694 100644 (file)
@@ -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 22a1304d5aae8718394805c97ccf527cf95514ed..93b078b45a01ce1ff9ca09317212605bd0646ba1 100644 (file)
--- 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;
 }
index d088828857b86730f1ebf9233374300f93a9a8fc..17b5476d0ddefc1f4ab7d1114a788b1af1cc1887 100644 (file)
@@ -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 626fc1952a6d976aad3b590086ed60942af294e4..8bb690b72e5134554e81e6d06e65b222965339ab 100644 (file)
--- 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 4a537bf33077d5490b6f3793a25d0a5f5ab0541e..d6cc82e3ee5cae81419ded7334fe66ed535a5314 100644 (file)
--- 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));
 }
index 6d5bd7fd17065028de96db20a3cc05125ee4cc3c..a2fff440cf50e7e775c0b5803937f287683ddc2b 100644 (file)
@@ -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);
        }
 
 
index b2acd78def36ed40c5f065d98ef1596a30b1bd3e..c460ffdd1cc045172d47a15b06a7c903bdd0105b 100644 (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;
                        }
diff --git a/grep.c b/grep.c
index 6d5bd7fd17065028de96db20a3cc05125ee4cc3c..a2fff440cf50e7e775c0b5803937f287683ddc2b 100644 (file)
--- 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);
        }
 
 
index a6e001d54459dcfb502d680c25c3818a35b1d1f8..f4118ea36727d0bdcaf4e3b682941ff5febd644a 100644 (file)
@@ -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 3f90d55f63b2321043e729c68721b390841ab309..85b288c0c2dc53d1717c2c9615450eac1099c694 100644 (file)
--- 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 89a8fe6a50e21fdf43f65a1cce10e9ea4cb68a13..cb17e2d752aae3de11733274af89678cdba0a1e8 100644 (file)
--- 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;
        }
index a6e001d54459dcfb502d680c25c3818a35b1d1f8..f4118ea36727d0bdcaf4e3b682941ff5febd644a 100644 (file)
@@ -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);
index 89a8fe6a50e21fdf43f65a1cce10e9ea4cb68a13..cb17e2d752aae3de11733274af89678cdba0a1e8 100644 (file)
@@ -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 b2acd78def36ed40c5f065d98ef1596a30b1bd3e..c460ffdd1cc045172d47a15b06a7c903bdd0105b 100644 (file)
--- 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;
                        }