Reading a text file that may have embedded nulls
I find your code hard to read, for the following reasons:


the variable file is not really a file but a buffer
the variable f (which usually stands for file) is a pointer into that buffer
the variable a has a name which does not convey any meaning at all
if the first if statement you indent the brace in the next line, and in the very last if statement the body is in the same line
there are spaces missing in the code at places where I expect them, such as after an if or for
the forever loop is usually written as for (;;), not for( ; ; )
the main block of the code is inside the for loop, and there's not a single empty line in that part. This suggests that the whole block is doing a single thing with no possible interruption or logical break
the comma operator is generally frowned upon
is_done is not really about the work being done, it's more about being successful


Because of all the above reasons, I would write the code differently:

#include &lt;errno.h&gt;
#include &lt;stdbool.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main(void) {
    char buf[1000];
    size_t buflen = 0;
    const size_t granularity = 80;

    while (true) {
        if (granularity &gt; sizeof buf - buflen) {
            errno = ERANGE;
            break;
        }

        size_t nread = fread(buf + buflen, 1, granularity, stdin);
        if (ferror(stdin))
            break;

        buflen += nread;
    }

    for (size_t i = 0; i &lt; buflen; i++)
        printf("%02hhX ", buf[i]);
    fputc('\n', stdout);

    if (ferror(stdin)) {
        perror("stdin");
        return EXIT_FAILURE;
    }
}


And here is what I changed:


I renamed all variables to match their purpose
I replaced the various pointers into the buffer with indexes
I removed the is_done variable since the program should not print an error just because the file is a multiple of 80 bytes
I moved the variable a to a smaller scope by declaring it inside the for loop where it is used; I also renamed it to i, since it is now an index instead of a pointer
I replaced the comma operator with an if statement, since that is the form that is commonly used
I included &lt;stdbool.h&gt; to have a boolean type and the constants true and false
I replaced for (;;) with while (true), which is less magic
I sorted the included headers alphabetically since for headers from the C standard library, the order doesn't matter
I renamed the variable read to nread, to avoid possible conflicts with the POSIX function of the same name