Fixed issue with cutting off remains of buffer for big files.

Signed-off-by: Daniel (dmilith) Dettlaff <dmilith@verknowsys.com>