diff --git a/build-project.sh b/build-project.sh index 9b064c8..ab820fc 100755 --- a/build-project.sh +++ b/build-project.sh @@ -14,8 +14,8 @@ ceedling test:all cd src/ -sed '/John Doe/,$d' employeeList.txt > temp.txt -mv temp.txt employeeList.txt +sed '/John Doe/,$d' employeesCredentialsList.txt > temp.txt +mv temp.txt employeesCredentialsList.txt # backup files for file in employeeLogin.c mainMenu.c createEmployeeAccount.c; do cp "$file" "$file.bak" diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index f2dcd1a..4af6f04 100644 --- a/src/createEmployeeAccount.c +++ b/src/createEmployeeAccount.c @@ -2,20 +2,21 @@ #include "createEmployeeAccount.h" - -int StringLengthCounter(char* string) +bool isValidEmployeeID(const char* employeeId, int maximumStringLength) { - int characterCounter = 0; - int i = 0; - while(string[i] !='\0') + int employeeIdLength = strlen(employeeId); + + for(int i=0;i