diff --git a/include/flags.h b/include/flags.h index c9707a1..fd35100 100644 --- a/include/flags.h +++ b/include/flags.h @@ -8,5 +8,7 @@ #define INVALID_KEY 1 #define VERSION "v1.1" +#define VERSIONS_URL "https://raw.githubusercontent.com/ENDev-WHY2/WHY2-Encryption-System/c/versions.json" +#define VERSIONS_NAME "versions.json" -#endif \ No newline at end of file +#endif diff --git a/src/encrypter.c b/src/encrypter.c index 70169d2..97a0681 100644 --- a/src/encrypter.c +++ b/src/encrypter.c @@ -19,10 +19,10 @@ encryptText(char *text, char *keyNew) //CURL VARIABLES CURL *curl = curl_easy_init(); - FILE *fileBuffer = fopen("versions.json", "w"); + FILE *fileBuffer = fopen(VERSIONS_NAME, "w"); //GET versions.json - curl_easy_setopt(curl, CURLOPT_URL, "https://raw.githubusercontent.com/ENDev-WHY2/WHY2-Encryption-System/c/versions.json"); + curl_easy_setopt(curl, CURLOPT_URL, VERSIONS_URL); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fileBuffer); //DOWNLOAD versions.json @@ -33,7 +33,7 @@ encryptText(char *text, char *keyNew) fclose(fileBuffer); //JSON VARIABLES - FILE *jsonFile = fopen("versions.json", "r"); + FILE *jsonFile = fopen(VERSIONS_NAME, "r"); char buffer[256]; char lineBuffer[64]; struct json_object *parsedJson; @@ -169,4 +169,4 @@ encryptText(char *text, char *keyNew) free(key); return returningText; -} \ No newline at end of file +}