diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index 308b390..9550f40 100644 --- a/src/createEmployeeAccount.c +++ b/src/createEmployeeAccount.c @@ -69,21 +69,15 @@ bool isValidName(char* name,const int minimalLength) bool isValidPhoneNumber(char *phoneNumber) { - const int validNumberLength = 14; int numberLength = strlen(phoneNumber); - if(numberLength != validNumberLength) - { - return false; - } - - if(phoneNumber[0]!='+' || phoneNumber[1]!='4' || phoneNumber[2]!='9') + /*this function checks if the 3 first characters a german suffix are*/ + if(phoneNumber[0]!='+' || phoneNumber[1]!='4' || phoneNumber[2]!='9' || numberLength != validNumberLength) { return false; } return true; - } int StringLengthCounter(char* string) diff --git a/src/createEmployeeAccount.h b/src/createEmployeeAccount.h index 03cd582..9c67108 100644 --- a/src/createEmployeeAccount.h +++ b/src/createEmployeeAccount.h @@ -10,6 +10,7 @@ #define minPasswordLength 5 #define minimumNameLength 4 #define maxLength 21 +#define validNumberLength 14 struct employeesInformations {