moved variables from flags.h to flags.c

this just makes flags safer
This commit is contained in:
Václav Šmejkal 2022-07-01 18:45:44 +02:00
parent f617d10343
commit 92dd06d8b0
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19
2 changed files with 7 additions and 3 deletions

View File

@ -43,9 +43,7 @@ typedef struct
unsigned char exitCode; //VARIABLE FOR EXIT CODE
} outputFlags;
//VARIABLES
static char encryptionSeparator = '.'; //NOPE > DO NOT TOUCH THIS, USE setEncryptionSeparator instead <
static unsigned long keyLength = 50; //LENGTH OF KEY > DO NOT TOUCH THIS, USE setKeyLength instead <
//NOTE: Variables were moved to 'flags.c' to force y'all using getters
//GETTERS
char getEncryptionSeparator();

View File

@ -2,6 +2,11 @@
#include <stdlib.h>
//VARIABLES
static char encryptionSeparator = '.'; //NOPE > DO NOT TOUCH THIS, USE setEncryptionSeparator instead <
static unsigned long keyLength = 50; //LENGTH OF KEY > DO NOT TOUCH THIS, USE setKeyLength instead <
//GETTERS
char getEncryptionSeparator()
{
return encryptionSeparator;
@ -32,6 +37,7 @@ outputFlags noOutput(unsigned char exitCode)
return (outputFlags) { emptyText, emptyKey, 0, 0, exitCode };
}
//SETTERS
void setEncryptionSeparator(char encryptionSeparatorNew)
{
if (encryptionSeparatorNew == '\0') return;