fixed possible memory issues
This commit is contained in:
parent
b970de23a5
commit
0d91ec777e
@ -33,20 +33,20 @@ encryptText(char *text, char *keyNew)
|
|||||||
fclose(fileBuffer);
|
fclose(fileBuffer);
|
||||||
|
|
||||||
//JSON VARIABLES
|
//JSON VARIABLES
|
||||||
FILE *jsonFile = fopen(VERSIONS_NAME, "r");
|
fileBuffer = fopen(VERSIONS_NAME, "r");
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char lineBuffer[64];
|
char lineBuffer[64];
|
||||||
struct json_object *parsedJson;
|
struct json_object *parsedJson;
|
||||||
struct json_object *active;
|
struct json_object *active;
|
||||||
|
|
||||||
//LOAD jsonFile
|
//LOAD jsonFile
|
||||||
while (fgets(lineBuffer, sizeof(lineBuffer), jsonFile) != NULL)
|
while (fgets(lineBuffer, sizeof(lineBuffer), fileBuffer) != NULL)
|
||||||
{
|
{
|
||||||
strcat(buffer, lineBuffer);
|
strcat(buffer, lineBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//CLEANUP
|
//CLEANUP
|
||||||
fclose(jsonFile);
|
fclose(fileBuffer);
|
||||||
|
|
||||||
//GET
|
//GET
|
||||||
parsedJson = json_tokener_parse(buffer);
|
parsedJson = json_tokener_parse(buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user