[hackers] [sbase] ls: printf("%s", s) -> fputs(s, stdout) || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 30 Sep 2015 20:44:17 +0200 (CEST)

commit aba450fd1a1e5256d4ad11a914524055e081c0e2
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Sun Sep 6 22:36:01 2015 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Sep 30 19:44:10 2015 +0100

    ls: printf("%s", s) -> fputs(s, stdout)

diff --git a/ls.c b/ls.c
index 5f43f37..1a31acb 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -335,7 +335,7 @@ ls(const char *path, const struct entry *ent, int listdir)
                 else
                         putchar('\n');
 
- printf("%s", path);
+ fputs(path, stdout);
                 lsdir(path, ent);
                 tree[treeind].ino = 0;
 
diff --git a/sed.c b/sed.c
index 4d35bb5..60dd37a 100644
--- a/sed.c
+++ b/sed.c
_AT_@ -1326,7 +1326,7 @@ cmd_l(Cmd *c)
          */
         for (p = patt.str, end = p + strlen(p); p < end; p += rlen) {
                 if (isascii(*p) && escapes[(unsigned int)*p]) {
- printf("%s", escapes[(unsigned int)*p]);
+ fputs(escapes[(unsigned int)*p], stdout);
                         rlen = 1;
                 } else if (!(rlen = charntorune(&r, p, end - p))) {
                         /* ran out of chars, print the bytes of the short sequence */
Received on Wed Sep 30 2015 - 20:44:17 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 30 2015 - 20:48:16 CEST