diff options
| author | Benedict <benedict@0xb8000.de> | 2017-02-21 12:52:02 +0100 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:25 +0100 |
| commit | ddce9b2d44ab48fc566870c5155b39c8fc06f24d (patch) | |
| tree | 61e6f8d636190ef19f75bfd9cd8e4861ee04cf4f /set1/hexdump.c | |
| parent | f71df313c4480fb3edd91edb572d8013bec6d352 (diff) | |
moved files of set1 into subdir
Diffstat (limited to 'set1/hexdump.c')
| -rw-r--r-- | set1/hexdump.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/set1/hexdump.c b/set1/hexdump.c new file mode 100644 index 0000000..57a17a1 --- /dev/null +++ b/set1/hexdump.c @@ -0,0 +1,16 @@ +#include "lib.h" + + +int main(int argc, char **argv) +{ + if( argc != 2) { + printf("Usage: %s <text>", argv[0]); + exit(1); + } + + char *hex_string = malloc(strlen(argv[1])*2+1); + + hex_binary_to_string(argv[1], hex_string, strlen(argv[1])); + hex_string[strlen(argv[1])*2+1] = '\0'; + printf("%s\n", hex_string); +} |
