[hackers] [sbase] Audit paste(1) || FRIGN

From: <git_AT_suckless.org>
Date: Thu, 19 Mar 2015 11:13:23 +0100 (CET)

commit 5ab190e6770e3841ea150dbe425d50a46a232689
Author: FRIGN <dev_AT_frign.de>
Date: Tue Mar 17 21:30:12 2015 +0100

    Audit paste(1)
    
    Well, basically there was not a lot to do, as I already (fortunately)
    audited this code a while back.
    There were only minor style-changes.

diff --git a/README b/README
index 7c29823..ec71a7f 100644
--- a/README
+++ b/README
_AT_@ -51,7 +51,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
 =*| nice yes none
 = nl no -d, -f, -h, -p
 =*| nohup yes none
-#* paste yes none
+#*| paste yes none
 =*| printenv non-posix none
 #* printf yes none
 =*| pwd yes none
diff --git a/paste.c b/paste.c
index a3b4078..f90f37f 100644
--- a/paste.c
+++ b/paste.c
_AT_@ -102,7 +102,7 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- if (argc == 0)
+ if (!argc)
                 usage();
 
         /* populate delimiters */
_AT_@ -114,7 +114,7 @@ main(int argc, char *argv[])
         dsc = ereallocarray(NULL, argc, sizeof(*dsc));
 
         for (i = 0; i < argc; i++) {
- if (strcmp(argv[i], "-") == 0)
+ if (!strcmp(argv[i], "-"))
                         dsc[i].fp = stdin;
                 else
                         dsc[i].fp = fopen(argv[i], "r");
Received on Thu Mar 19 2015 - 11:13:23 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 19 2015 - 11:24:20 CET