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:
parent
bcb33ad354
commit
f7d8bb052e
@ -87,6 +87,12 @@ outputFlags decryptText(char *text, char *keyNew)
|
|||||||
textBuffer = malloc(numberBuffer + 1);
|
textBuffer = malloc(numberBuffer + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CLEAN (POSSIBLY EXISTING) JUNK in textBuffer
|
||||||
|
for (int i = 0; i <= numberBuffer; i++)
|
||||||
|
{
|
||||||
|
textBuffer[i] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
//LOAD textBuffer
|
//LOAD textBuffer
|
||||||
for (int j = 0; j < (int) strlen(text); j++)
|
for (int j = 0; j < (int) strlen(text); j++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user