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

From: <git_AT_suckless.org>
Date: Sat, 28 Feb 2015 20:40:39 +0100 (CET)

commit 497da9d1ddb596da888b9b21c5bac429555c417c
Author: FRIGN <dev_AT_frign.de>
Date: Sat Feb 28 20:05:22 2015 +0100

    Audit unlink(1)
    
    One small thing, use argv0 in usage.
    Also, add a blank line in link.c which I forgot earlier.

diff --git a/README b/README
index 5edba2e..ffcc382 100644
--- a/README
+++ b/README
_AT_@ -82,7 +82,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
 =* uname yes none
 #* unexpand yes none
 =* uniq yes none
-=* unlink yes none
+=*| unlink yes none
 =* uudecode yes none
 =* uuencode yes none
 #* wc yes none
diff --git a/link.c b/link.c
index 5ef8e11..6af7544 100644
--- a/link.c
+++ b/link.c
_AT_@ -19,6 +19,7 @@ main(int argc, char *argv[])
 
         if (argc != 2)
                 usage();
+
         if (link(argv[0], argv[1]) < 0)
                 eprintf("link:");
 
diff --git a/unlink.c b/unlink.c
index 077959c..797d18a 100644
--- a/unlink.c
+++ b/unlink.c
_AT_@ -6,7 +6,7 @@
 static void
 usage(void)
 {
- eprintf("usage: unlink file\n");
+ eprintf("usage: %s file\n", argv0);
 }
 
 int
Received on Sat Feb 28 2015 - 20:40:39 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 28 2015 - 20:48:13 CET