fixed decryption bug

basically, the buffer had some content after allocation in it, so it screwed up last character in 1/10 cases
This commit is contained in:
Václav Šmejkal 2022-07-19 17:18:00 +02:00
parent bcb33ad354
commit f7d8bb052e
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -87,6 +87,12 @@ outputFlags decryptText(char *text, char *keyNew)
textBuffer = malloc(numberBuffer + 1);
}
//CLEAN (POSSIBLY EXISTING) JUNK in textBuffer
for (int i = 0; i <= numberBuffer; i++)
{
textBuffer[i] = '\0';
}
//LOAD textBuffer
for (int j = 0; j < (int) strlen(text); j++)
{