The current logic was causing loading to omit the last character because the EOF flag was triggered too early.
#pragma once