]> diplodocus.org Git - nmh/commitdiff
Replace printf("%s\n", foo) and similar with puts(foo).
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 10:21:42 +0000 (11:21 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 10:21:42 +0000 (11:21 +0100)
sbr/netsec.c
sbr/pidstatus.c
test/fakesmtp.c
test/getcanon.c
test/getfullname.c
uip/mhical.c
uip/popsbr.c

index edb8d8c..bdf39a3 100644 (file)
@@ -461,8 +461,10 @@ retry:
                if (nsc->ns_snoop_cb)
                    nsc->ns_snoop_cb(nsc, sptr, strlen(sptr),
                                     nsc->ns_snoop_context);
-               else
-                   fprintf(stderr, "%s\n", sptr);
+               else {
+                    fputs(sptr, stderr);
+                    putc('\n', stderr);
+                }
            }
            return sptr;
        }
index 6e4c2c7..d11a37e 100644 (file)
@@ -61,8 +61,11 @@ pidstatus (int status, FILE *fp, char *cp)
            if (signame)
                fprintf (fp, " (%s%s)\n", signame,
                         WCOREDUMP(status) ? ", core dumped" : "");
-           else
-               fprintf (fp, "%s\n", WCOREDUMP(status) ? " (core dumped)" : "");
+           else {
+                if (WCOREDUMP(status))
+                    fputs(" (core dumped)", fp);
+                putc('\n', fp);
+            }
        }
     }
 
index 3523095..d48531d 100644 (file)
@@ -71,7 +71,8 @@ main(int argc, char *argv[])
                if (rc == -1)
                        break;  /* EOF */
 
-               fprintf(f, "%s\n", line);
+                fputs(line, f);
+                putc('\n', f);
 
                switch (smtp_state) {
                case SMTP_DATA:
index ada6802..3e75f32 100644 (file)
@@ -46,10 +46,10 @@ main(int argc, char *argv[])
   hints.ai_family = AF_UNSPEC;
 
   if (getaddrinfo(hostname, NULL, &hints, &res)) {
-    printf("%s\n", hostname);
+    puts(hostname);
     return 1;
   }
-  printf("%s\n", res->ai_canonname);
+  puts(res->ai_canonname);
 
   return 0;
 }
index 89a5491..9a342ca 100644 (file)
@@ -53,8 +53,7 @@ main(int argc, char *argv[])
         * Quote the entire string if it has a special character in it.
         */
        escape_display_name (buf, sizeof(buf));
-
-       printf("%s\n", buf);
+       puts(buf);
 
        exit(0);
 }
index 3249d08..d62fce9 100644 (file)
@@ -535,11 +535,10 @@ output (FILE *file, contentline *clines, int contenttype) {
             line = fold (add (node->value, line),
                          clines->cr_before_lf == CR_BEFORE_LF);
 
-            if (clines->cr_before_lf == LF_ONLY) {
-                fprintf (file, "%s\n", line);
-            } else {
-                fprintf (file, "%s\r\n", line);
-            }
+            fputs(line, file);
+            if (clines->cr_before_lf != LF_ONLY)
+                putc('\r', file);
+            putc('\n', file);
             free (line);
         }
     }
index ecf1aa3..a931905 100644 (file)
@@ -270,8 +270,10 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop,
 
        case NOTOK: 
        case DONE: 
-           if (poprint)            
-               fprintf (stderr, "%s\n", response);
+           if (poprint) {
+               fputs(response, stderr);
+                putc('\n', stderr);
+            }
            netsec_shutdown(nsc);
            nsc = NULL;
            return NOTOK;
@@ -596,8 +598,10 @@ vcommand (const char *fmt, va_list ap)
 
        case NOTOK: 
        case DONE: 
-           if (poprint)            
-               fprintf (stderr, "%s\n", response);
+           if (poprint) {
+               fputs(response, stderr);
+                putc('\n', stderr);
+            }
            return NOTOK;
     }