diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index db149f8..3fb19e5 100644 --- a/src/createEmployeeAccount.c +++ b/src/createEmployeeAccount.c @@ -2,7 +2,7 @@ #include "createEmployeeAccount.h" -bool isValidEmployeeID(const char* employeeId, int maximumStringLength) +bool isValidEmployeeID(const char* employeeId,const int maximumStringLength) { int employeeIdLength = strlen(employeeId); /* looping through the employeeId string until a space is found to return false or true otherwise*/ @@ -17,7 +17,7 @@ bool isValidEmployeeID(const char* employeeId, int maximumStringLength) } -bool isValidPassword( char *password, int minimumLength) +bool isValidPassword( char *password,const int minimumLength) { /*created a pointer(*stringpointer) which helps loop through characters of the string password*/ char *stringpointer = password; @@ -48,20 +48,21 @@ bool isValidPassword( char *password, int minimumLength) } -bool isValidName(char* name, int minimalLength) +bool isValidName(char* name,const int minimalLength) { - if(strlen(name) < minimalLength) + int nameLength = strlen(name); + if(nameLength < minimalLength) { return false; } - for(int i = 0;i #include +#define minPasswordLength 5 +#define minimumNameLength 4 +#define maxLength 21 + struct employeesInformations { char firstName[15];