made 'else' prettier

This commit is contained in:
Václav Šmejkal 2022-06-10 19:48:45 +02:00
parent fafb8e8870
commit 7d36275b2a
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19
2 changed files with 8 additions and 4 deletions

View File

@ -65,7 +65,8 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
if (numberBuffer > 26) if (numberBuffer > 26)
{ {
numberBuffer += 70; numberBuffer += 70;
} else }
else
{ {
numberBuffer += 64; numberBuffer += 64;
} }
@ -104,7 +105,8 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
if (i != 0) if (i != 0)
{ {
textBuffer = realloc(textBuffer, numberBuffer); textBuffer = realloc(textBuffer, numberBuffer);
} else }
else
{ {
textBuffer = malloc(numberBuffer); textBuffer = malloc(numberBuffer);
} }

View File

@ -157,10 +157,12 @@ void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize)
if ((numberBuffer + 1) % 3 == 0) if ((numberBuffer + 1) % 3 == 0)
{ {
textKeyChain[i] = key[numberBuffer] * key[numberBuffer2]; textKeyChain[i] = key[numberBuffer] * key[numberBuffer2];
} else if ((numberBuffer + 1) % 2 == 0) }
else if ((numberBuffer + 1) % 2 == 0)
{ {
textKeyChain[i] = key[numberBuffer] - key[numberBuffer2]; textKeyChain[i] = key[numberBuffer] - key[numberBuffer2];
} else }
else
{ {
textKeyChain[i] = key[numberBuffer] + key[numberBuffer2]; textKeyChain[i] = key[numberBuffer] + key[numberBuffer2];
} }