@ -16,11 +16,11 @@ int StringLengthCounter(char* string)
return characterCounter ;
}
bool isValidPassword ( char * em ployeeP assword, int minimumString Length )
bool isValidPassword ( char * password , int minimumLength )
{
char * stringpointer = employeePassword ;
int employeePasswordLength = 0 ;
bool letterFound = false , punctuation Found = false , numberFound = false ;
/*created a pointer(*stringpointer) which helps loop through characters of the string password*/
char * stringpointer = password ;
bool letterFound = false , symbol Found = false , numberFound = false ;
while ( * stringpointer ! = ' \0 ' )
{
@ -34,14 +34,13 @@ bool isValidPassword(char* employeePassword, int minimumStringLength)
}
else if ( ispunct ( * stringpointer ) )
{
punctuation Found = true ;
symbol Found = true ;
}
if ( employeePasswordLength > = minimumString Length & & letterFound & & numberFound & & punctuation Found)
if ( strlen ( password ) > = minimumLength & & letterFound & & numberFound & & symbol Found)
{
return true ;
}
+ + stringpointer ;
+ + employeePasswordLength ;
}
return false ;
@ -112,7 +111,7 @@ void getNewEmployeeCredentials()
else if ( isValidEmployeeID ( employeeId , employeeIdLength ) & & ! isValidPassword ( employeePassword , minimumPasswordLength ) )
{
printf ( " Error : the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 punctuation character ! " ) ;
printf ( " Error : the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 symbol ! " ) ;
}
else