Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Müller <mail@mueller-martin.net>2017-02-24 05:59:06 +0300
committerMartin Müller <mail@mueller-martin.net>2017-02-24 05:59:06 +0300
commit1939ea85567a607aff6847607ae9b8a38918d20c (patch)
tree3cd86e8ab8ef0c2e818426ac068b554f8694a52d
parent40ccf5e3537ff6b2e5ceac5747f376a2ef430bec (diff)
Let the program get its name from its arguments
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 92de0d9..81a2ad2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <libgen.h>
#include "sha1.h"
@@ -22,7 +23,7 @@ int main(int argc, char** argv)
if (argc < 2)
{
- printf("Usage: test <file>\n");
+ printf("Usage: %s <file>\n", basename(argv[0]));
return 1;
}