diff options
author | Nathan Lasseter <nathan.je.lasseter@googlemail.com> | 2012-06-05 19:42:50 +0100 |
---|---|---|
committer | Nathan Lasseter <nathan.je.lasseter@googlemail.com> | 2012-06-05 19:42:50 +0100 |
commit | 24d5390ccaec7d542656caa2a6190256e1d6b8b9 (patch) | |
tree | ed81bb549bbc19918307c62968f36bb9cb1f26b1 /encrypt.c | |
parent | 8330cef7c4e11024d66a3db37bb9b0f22429fbec (diff) |
SimpleCrypt 0.4 (copied in for historical reasons)
Diffstat (limited to 'encrypt.c')
-rw-r--r-- | encrypt.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -2,16 +2,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> - -void sanitise(char *x) { - char *curpos = x; - while (*x != '\0') { - *curpos = *x; - x++; - if (*curpos != '/') curpos++; - } - *curpos = '\0'; -} +#include <time.h> 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]; |