reverted the demented why2_get_version
This commit is contained in:
parent
6adf4a391a
commit
41bbfc2b18
@ -30,7 +30,6 @@ extern "C" {
|
|||||||
void why2_generate_text_key_chain(char *key, int *text_key_chain, int text_key_chain_size); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION
|
void why2_generate_text_key_chain(char *key, int *text_key_chain, int text_key_chain_size); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION
|
||||||
char *why2_generate_key(int key_length); //GENERATE ENCRYPTION KEY
|
char *why2_generate_key(int key_length); //GENERATE ENCRYPTION KEY
|
||||||
void why2_deallocate_output(why2_output_flags flags); //DEALLOCATES flags
|
void why2_deallocate_output(why2_output_flags flags); //DEALLOCATES flags
|
||||||
char *why2_get_version(void); //GET VERSION FILE OF WHY2
|
|
||||||
enum WHY2_EXIT_CODES why2_check_version(void); //THIS FUNCTION CHECKS IF LATEST WHY2_VERSION OF WHY2 IS USED
|
enum WHY2_EXIT_CODES why2_check_version(void); //THIS FUNCTION CHECKS IF LATEST WHY2_VERSION OF WHY2 IS USED
|
||||||
enum WHY2_EXIT_CODES why2_check_key(char *key); //CHECKS IF KEY IS VALID
|
enum WHY2_EXIT_CODES why2_check_key(char *key); //CHECKS IF KEY IS VALID
|
||||||
enum WHY2_EXIT_CODES why2_check_text(char *text); //CHECKS IF TEXT IS VALID
|
enum WHY2_EXIT_CODES why2_check_text(char *text); //CHECKS IF TEXT IS VALID
|
||||||
|
@ -52,31 +52,6 @@ int removeDirectory(char *path)
|
|||||||
return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);
|
return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *why2_get_version(void)
|
|
||||||
{
|
|
||||||
//COUNT LENGTH OF buffer AND STORE IT IN bufferSize
|
|
||||||
FILE *file_buffer = why2_fopen(WHY2_VERSIONS_NAME, "r");
|
|
||||||
fseek(file_buffer, 0, SEEK_END);
|
|
||||||
long buffer_size = ftell(file_buffer);
|
|
||||||
rewind(file_buffer); //REWIND file_buffer (NO SHIT)
|
|
||||||
|
|
||||||
//SET LENGTH OF buffer
|
|
||||||
char *buffer = why2_calloc(buffer_size + 1, sizeof(char));
|
|
||||||
|
|
||||||
//LOAD jsonFile
|
|
||||||
if (fread(buffer, buffer_size, 1, file_buffer) != 1)
|
|
||||||
{
|
|
||||||
if (!why2_get_flags().no_output) fprintf(stderr, "Reading file failed!\n");
|
|
||||||
|
|
||||||
// BELOW CODE IS COMMENTED OUT, BECAUSE IT IS PROBABLY UNNECESSARY
|
|
||||||
// why2_clean_memory("core_version_check");
|
|
||||||
// return WHY2_DOWNLOAD_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[buffer_size] = '\0';
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum WHY2_EXIT_CODES why2_check_version(void)
|
enum WHY2_EXIT_CODES why2_check_version(void)
|
||||||
{
|
{
|
||||||
if (why2_get_flags().no_check) return WHY2_SUCCESS;
|
if (why2_get_flags().no_check) return WHY2_SUCCESS;
|
||||||
@ -119,10 +94,32 @@ enum WHY2_EXIT_CODES why2_check_version(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//JSON VARIABLES
|
//JSON VARIABLES
|
||||||
char *buffer = why2_get_version();
|
char *buffer;
|
||||||
|
long buffer_size;
|
||||||
struct json_object *parsed_json;
|
struct json_object *parsed_json;
|
||||||
struct json_object *active;
|
struct json_object *active;
|
||||||
|
|
||||||
|
//COUNT LENGTH OF buffer AND STORE IT IN bufferSize
|
||||||
|
file_buffer = why2_fopen(WHY2_VERSIONS_NAME, "r");
|
||||||
|
fseek(file_buffer, 0, SEEK_END);
|
||||||
|
buffer_size = ftell(file_buffer);
|
||||||
|
rewind(file_buffer); //REWIND file_buffer (NO SHIT)
|
||||||
|
|
||||||
|
//SET LENGTH OF buffer
|
||||||
|
buffer = why2_calloc(buffer_size + 1, sizeof(char));
|
||||||
|
|
||||||
|
//LOAD jsonFile
|
||||||
|
if (fread(buffer, buffer_size, 1, file_buffer) != 1)
|
||||||
|
{
|
||||||
|
if (!why2_get_flags().no_output) fprintf(stderr, "Reading file failed!\n");
|
||||||
|
|
||||||
|
// BELOW CODE IS COMMENTED OUT, BECAUSE IT IS PROBABLY UNNECESSARY
|
||||||
|
// why2_clean_memory("core_version_check");
|
||||||
|
// return WHY2_DOWNLOAD_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer[buffer_size] = '\0';
|
||||||
|
|
||||||
//CHECK FOR TEXT IN buffer
|
//CHECK FOR TEXT IN buffer
|
||||||
if (strcmp(buffer, "") == 0)
|
if (strcmp(buffer, "") == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user