summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lasseter <nathan.je.lasseter@googlemail.com>2012-06-05 19:42:50 +0100
committerNathan Lasseter <nathan.je.lasseter@googlemail.com>2012-06-05 19:42:50 +0100
commit24d5390ccaec7d542656caa2a6190256e1d6b8b9 (patch)
treeed81bb549bbc19918307c62968f36bb9cb1f26b1
parent8330cef7c4e11024d66a3db37bb9b0f22429fbec (diff)
SimpleCrypt 0.4 (copied in for historical reasons)
-rw-r--r--encrypt.c16
1 files 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 <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];