From 24d5390ccaec7d542656caa2a6190256e1d6b8b9 Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Tue, 5 Jun 2012 19:42:50 +0100 Subject: SimpleCrypt 0.4 (copied in for historical reasons) --- encrypt.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/encrypt.c b/encrypt.c index a8cfec1..172fbbd 100644 --- a/encrypt.c +++ b/encrypt.c @@ -2,16 +2,7 @@ #include #include #include - -void sanitise(char *x) { - char *curpos = x; - while (*x != '\0') { - *curpos = *x; - x++; - if (*curpos != '/') curpos++; - } - *curpos = '\0'; -} +#include int main(int argc, char** argv) { char * junk; @@ -24,8 +15,9 @@ int main(int argc, char** argv) { FILE* file = fopen(argv[1], "r"); /* And a temporary file to hold the encrypted data */ char tpath[255] = "/tmp/"; - sanitise(argv[1]); - strcat(tpath, argv[1]); + char timeS[32]; + sprintf(timeS, "%d", (int) time(NULL)); + strcat(tpath, timeS); FILE* temp = fopen(tpath, "w"); char passphrase[255]; -- cgit v1.2.1