ifstream::read() sets the failbit if trying to read over the end, which means that (!input) would be hit for the 'last' block if it wasn't exactly BSIZE (1024) bytes.
ifstream::read() sets the failbit if trying to read over the end, which means that (!input) would be hit for the 'last' block if it wasn't exactly BSIZE (1024) bytes.