diff options
-rw-r--r-- | onetimebluh.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/onetimebluh.c b/onetimebluh.c index 3516cd3..e6366f0 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -1,7 +1,10 @@ -#include<stdio.h> -#include<stdlib.h> -#include<getopt.h> -#include<openssl/rand.h> +#include <stdio.h> +#include <stdlib.h> +#include <getopt.h> +#include <openssl/rand.h> +#include <unistd.h> +#include <errno.h> +#include <error.h> void xor(char* mess, char* keyf, char* outp); void keyrand(int nb, char* outp); @@ -91,6 +94,12 @@ void xor(char* mess, char* keyf, char* outp) { char* defoutp = "critt"; + if (access(mess, F_OK) == -1) { + error(errno, errno, mess); + } else if (access(keyf, F_OK) == -1) { + error(errno, errno, keyf); + } + if (outp == NULL) { printf("WARNING no output name specified using default value 'critt' \n"); outp = defoutp; |