Removed usage of non-standard function fopen_s