changed all other checking functions type to int
This commit is contained in:
parent
d196818ec0
commit
827331c2ff
@ -5,11 +5,11 @@
|
||||
|
||||
#include <why2/flags.h>
|
||||
|
||||
int checkVersion(inputFlags flags); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED
|
||||
void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION
|
||||
void deallocateOutput(outputFlags flags); //DEALLOCATES flags
|
||||
void checkKey(char *key, inputFlags flags); //CHECKS IF KEY IS VALID
|
||||
void checkText(char *text, inputFlags flags); //CHECKS IF TEXT IS VALID
|
||||
int checkVersion(inputFlags flags); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED
|
||||
int checkKey(char *key, inputFlags flags); //CHECKS IF KEY IS VALID
|
||||
int checkText(char *text, inputFlags flags); //CHECKS IF TEXT IS VALID
|
||||
unsigned long countIntLength(int number); //RETURNS LENGTH OF number
|
||||
unsigned long countUnusedKeySize(char *text, char *key); //COUNT unusedKeySize
|
||||
unsigned long compareTimeMicro(struct timeval startTime, struct timeval finishTime); //COMPARE TIMES IN MICROSECONDS
|
||||
|
@ -287,21 +287,21 @@ void deallocateOutput(outputFlags flags)
|
||||
free(flags.usedKey);
|
||||
}
|
||||
|
||||
void checkKey(char *key, inputFlags flags)
|
||||
int checkKey(char *key, inputFlags flags)
|
||||
{
|
||||
if (strlen(key) < getKeyLength())
|
||||
{
|
||||
if (!flags.noOutput) fprintf(stderr, "Key must be at least %lu characters long!\n", getKeyLength());
|
||||
return noOutput(INVALID_KEY);
|
||||
return INVALID_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
void checkText(char *text, inputFlags flags)
|
||||
int checkText(char *text, inputFlags flags)
|
||||
{
|
||||
if (strcmp(text, "") == 0)
|
||||
{
|
||||
if (!flags.noOutput) fprintf(stderr, "No text to encrypt!\n");
|
||||
return noOutput(INVALID_TEXT);
|
||||
return INVALID_TEXT;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user