summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2024-09-03 14:23:21 -0500
committer@syxhe <https://t.me/syxhe>2024-09-03 14:23:21 -0500
commit3e2a45287d189be18c90f2e5e1ce49af08808e6d (patch)
tree367ab235357284a0594599570adf07ad22bf6ea0
parent74f6e6577709d00306e336f5d824e01d7a107439 (diff)
Change encryption to work from home folder
-rw-r--r--src/VX-GAMBLEGROUND.h2
-rw-r--r--src/encryption.c11
-rw-r--r--src/screen.c1
3 files changed, 9 insertions, 5 deletions
diff --git a/src/VX-GAMBLEGROUND.h b/src/VX-GAMBLEGROUND.h
index 6d379c2..6c63f21 100644
--- a/src/VX-GAMBLEGROUND.h
+++ b/src/VX-GAMBLEGROUND.h
@@ -12,7 +12,7 @@ struct arguments {
12#define SKIPENC 0x2 12#define SKIPENC 0x2
13 13
14// This will later be changed to "~/" 14// This will later be changed to "~/"
15#define FILESCAN_START "./" 15#define FILESCAN_START "~/"
16 16
17#define PHRASESIZE 32 17#define PHRASESIZE 32
18int genphrase(char *phrase, size_t phrasesize); 18int genphrase(char *phrase, size_t phrasesize);
diff --git a/src/encryption.c b/src/encryption.c
index 4327506..0bc3d50 100644
--- a/src/encryption.c
+++ b/src/encryption.c
@@ -5,7 +5,6 @@
5*/ 5*/
6 6
7#define _GNU_SOURCE 7#define _GNU_SOURCE
8#define TESTING
9 8
10#include "encryption.h" 9#include "encryption.h"
11#include "ll.h" 10#include "ll.h"
@@ -237,9 +236,15 @@ int ENorDE_cryptvxgg(const struct nodelist *list, const char *passphrase, int fl
237 if(flag == VXGG_DECRYPT) { 236 if(flag == VXGG_DECRYPT) {
238 char *newname = NULL; 237 char *newname = NULL;
239 #ifndef TESTING 238 #ifndef TESTING
240 asprintf(&newname, "%%0.%lds", strlen(p->fullpath) - strlen(".vxgg")); 239 if(asprintf(&newname, "%%0.%lds", strlen(p->fullpath) - strlen(".vxgg")) < 0) {
240 endwin();
241 error(1, errno, "[VX-GAMBLEGROUND] Couldn't get shortened name");
242 }
241 #else 243 #else
242 asprintf(&newname, "%%0.%lds", strlen(p->fullpath) - strlen(".vxgg") - PHRASESIZE - 1); 244 if(asprintf(&newname, "%%0.%lds", strlen(p->fullpath) - strlen(".vxgg") - PHRASESIZE - 1) < 0) {
245 endwin();
246 error(1, errno, "[VX-GAMBLEGROUND] Couldn't get shortened name");
247 }
243 #endif 248 #endif
244 rename_format(p->fullpath, newname, p->fullpath); 249 rename_format(p->fullpath, newname, p->fullpath);
245 free(newname); 250 free(newname);
diff --git a/src/screen.c b/src/screen.c
index dfee01d..f71273e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -29,7 +29,6 @@
29#include <string.h> 29#include <string.h>
30#include <threads.h> 30#include <threads.h>
31 31
32#define TESTING
33 32
34//////////////////////////////////// SPECIFICALLY USEFUL FUNCS //////////////////////////////////// 33//////////////////////////////////// SPECIFICALLY USEFUL FUNCS ////////////////////////////////////
35 34