From d2e94cb263ab933103e1968c0f3da638f35f5983 Mon Sep 17 00:00:00 2001 From: Benedict Date: Fri, 4 Mar 2016 10:54:20 +0100 Subject: added task 1 agian in new infrastrucre also added a test for task1 --- task1.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 task1.c (limited to 'task1.c') diff --git a/task1.c b/task1.c new file mode 100644 index 0000000..886365b --- /dev/null +++ b/task1.c @@ -0,0 +1,22 @@ +#include "lib.h" + + +int main(int argc, char **argv) +{ + if (argc != 2) + return 0; + + + char *result = malloc(strlen(argv[1])); + char *base64 = malloc(strlen(argv[1])); + + decode_hex_string(argv[1], result); + encode_to_base64(result, base64); + + printf("%s\n", base64); + + free(result); + free(base64); + return 0; + +} -- cgit v1.2.3-70-g09d2