how many characters does this read before it will return from outside loop?
char *partial_read(int fd) {
    char *buf = malloc(sizeof(char) * BUFSIZE);
    buf[BUFSIZE - 1] = '\0';
    int inbuf = 0;
    int room = sizeof(buf);
    char *after = buf;
    int nbytes;
    while ((nbytes = read(fd, after, room)) > 0) {
        inbuf += nbytes;
        int where;

        if ((where = find_network_newline(buf, inbuf)) > 0) {
            printf("returned here!\n");

            buf[where - 2] = '\0';
            inbuf -= where;
            memmove(buf, buf + where, inbuf);

            return buf;
        }

        after = buf + inbuf;
        room = sizeof(buf) - inbuf;
    }
    printf("returned outside loop!\n");
    return buf;
}
