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

    int where;

    // Step 2: the loop condition below calls find_network_newline
    // to determine if a full line has been read from the client.
    // Your next task should be to implement find_network_newline
    // (found at the bottom of this file).
    //
    // Note: we use a loop here because a single read might result in
    // more than one full line.
    while ((where = find_network_newline(buf, inbuf)) > 0) {
        // where is now the index into buf immediately after
        // the first network newline
        // Step 3: Okay, we have a full line.
        // Output the full line, not including the "\r\n",
        // using print statement below.
        // Be sure to put a '\0' in the correct place first;
        // otherwise you'll get junk in the output.
        buf[where - 2] = '\0';

        printf("Next message: %s\n", buf);
        // Note that we could have also used write to avoid having to
        // put the '\0' in the buffer. Try using write later!

        // Step 4: update inbuf and remove the full line from the buffer
        // There might be stuff after the line, so don't just do inbuf = 0.

        // You want to move the stuff after the full line to the beginning
        // of the buffer.  A loop can do it, or you can use memmove.
        // memmove(destination, source, number_of_bytes)
        inbuf -= where;
        memmove(buf, inbuf, sizeof(buf) - sizeof(inbuf));
    }