moved fileBuffer deallocation to beggining of encrypter

it for some reason threw segfault
This commit is contained in:
Václav Šmejkal 2022-05-24 18:21:33 +02:00
parent cfb55cd493
commit d63c97614f

View File

@ -25,6 +25,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
fileBuffer = fopen("/dev/urandom", "r");
fread(&numberBuffer, 4, 1, fileBuffer);
srand(numberBuffer);
fclose(fileBuffer);
if (keyNew != NULL)
{
@ -112,7 +113,6 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
};
//DEALLOCATION
fclose(fileBuffer);
free(textKeyChain);
free(textBuffer);