correct fread return value checking
update buffer size after malloc/realloc
added mayak.dat file for testing