fixed unused copy of usedText

idk
This commit is contained in:
Václav Šmejkal 2023-01-26 12:52:22 +01:00
parent bf96f9e55e
commit 44bc62c73b
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59

View File

@ -60,13 +60,13 @@ outputFlags decryptText(char *text, char *keyNew)
//VARIABLES //VARIABLES
char *returningText; char *returningText;
int numberBuffer = 1; int numberBuffer = 1;
int usedTextDeallocationBuffer = 0;
char *textBuffer = malloc(1); char *textBuffer = malloc(1);
int textKeyChainLength; int textKeyChainLength;
int *textKeyChain; int *textKeyChain;
char *key = strdup(keyNew); //COPY keyNew TO key char *key = strdup(keyNew); //COPY keyNew TO key
int *encryptedTextKeyChain; int *encryptedTextKeyChain;
char *usedText = strdup(text); //COPY text TO usedText char *usedText = strdup(text); //COPY text TO usedText
char *usedTextCopy = usedText; //TODO: wtf
//GET LENGTH OF returningText AND textKeyChain //GET LENGTH OF returningText AND textKeyChain
for (int i = 0; i < (int) strlen(usedText); i++) for (int i = 0; i < (int) strlen(usedText); i++)
@ -115,6 +115,7 @@ outputFlags decryptText(char *text, char *keyNew)
encryptedTextKeyChain[i] = atoi(textBuffer); encryptedTextKeyChain[i] = atoi(textBuffer);
usedText += numberBuffer + 1; usedText += numberBuffer + 1;
usedTextDeallocationBuffer += numberBuffer + 1;
} }
//DECRYPT TEXT //DECRYPT TEXT
@ -150,7 +151,7 @@ outputFlags decryptText(char *text, char *keyNew)
free(textKeyChain); free(textKeyChain);
free(encryptedTextKeyChain); free(encryptedTextKeyChain);
free(textBuffer); free(textBuffer);
free(usedTextCopy); free(usedText - usedTextDeallocationBuffer);
return output; return output;
} }