replaced non-standard fopen_s