int main(void){
    int n, user_length;
    char userid[MAXLINE];
    char password[MAXLINE];

    if((n = read(STDIN_FILENO, userid, MAX_PASSWORD)) == -1) {
        perror("read");
        exit(1);
    } else if(n == 0) {
        fprintf(stderr, "Error: could not read from stdin");
        exit(1);
    }

    // Make sure user id is null-terminated
    if(n <= MAX_PASSWORD) {
        userid[n] ='\0';
    }

    // Remove newline character if it exists
    char *newline;
    if((newline = strchr(userid, '\n')) != NULL) {
        *newline = '\0';
    }

    if((n = read(STDIN_FILENO, password, MAX_PASSWORD)) == -1) {
        perror("read");
        exit(1);
    } else if(n == 0) {
        fprintf(stderr, "Error: could not read from stdin");
        exit(1);
    }

    // Make sure password is null-terminated
    if(n <= MAX_PASSWORD) {
        password[n] ='\0';
    } 

    // Remove newline character if it exists
    if((newline = strchr(password, '\n')) != NULL) {
        *newline = '\0';
    }