did i correctly update inbuf to the correct value
char buf[BUFSIZE] = {'\0'};
int inbuf = 0;           // How many bytes currently in buffer?
int room = sizeof(buf);  // How many bytes remaining in buffer?
char *after = buf;       // Pointer to position after the data in buf

int nbytes;
while ((nbytes = read(fd, after, room)) > 0) {
    // Step 1: update inbuf (how many bytes were just added?)
    inbuf = nbytes;

    int where;