int howmuchIread = 0; while ( ( howmuchIread = fread ( buffer, 1, READSIZE, fp ) ) != 0 ) { buffer[ howmuchIread ] = 0; //place terminal character to avoid overruns
I hope you realize that the code in the last line above will likely cause buffer overflow. Lets say howmuchIread == READSIZE, which is the same as sizeof(buffer). Then buffer[howmuchIread] will be one byte beyond the end of the buffer.
if u look closer at the code, u will see that buffer is buffer[BUFFSIZE], and BUFFSIE = READSIZE + 1, so... no overrun there :)