Skip to content

Commit

Permalink
Merge pull request #73 from fischerling/improve-login
Browse files Browse the repository at this point in the history
Improve login
  • Loading branch information
Galfurian authored Apr 2, 2024
2 parents 38aa091 + 1a1f3ef commit d3d7eaa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions programs/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ static inline void __print_message_file(const char *file)
if ((fd = open(file, O_RDONLY, 0600)) == -1) {
return;
}
// Read the lines of the file.
// Print the file.
while ((nbytes = read(fd, buffer, sizeof(char) * 256)) > 0) {
// Tap the string.
buffer[nbytes] = 0;
// TODO: Parsing message files for special characters (such as `\t` for time).
printf("%s\n", buffer);
write(STDOUT_FILENO, buffer, nbytes);
total += nbytes;
}
close(fd);
Expand Down Expand Up @@ -182,12 +182,12 @@ int main(int argc, char **argv)
do {
// Get the username.
do {
printf("Username :");
printf("Username: ");
} while (!__get_input(username, sizeof(username), false));

// Get the password.
do {
printf("Password :");
printf("Password: ");
} while (!__get_input(password, sizeof(password), true));

// Check if we can find the user.
Expand Down

0 comments on commit d3d7eaa

Please sign in to comment.