From 9a2f3d3377b82b597f00d1d8fb8ee58d141cfb95 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 21:12:14 +0000 Subject: More string safety stuff --- Stars45/AudioConfig.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Stars45/AudioConfig.cpp') diff --git a/Stars45/AudioConfig.cpp b/Stars45/AudioConfig.cpp index 7a7565a..d833533 100644 --- a/Stars45/AudioConfig.cpp +++ b/Stars45/AudioConfig.cpp @@ -233,7 +233,8 @@ AudioConfig::Load() int blocklen = 0; const char* filename = "audio.cfg"; - FILE* f = ::fopen(filename, "rb"); + FILE* f; + ::fopen_s(&f, filename, "rb"); if (f) { ::fseek(f, 0, SEEK_END); @@ -363,7 +364,8 @@ AudioConfig::Load() void AudioConfig::Save() { - FILE* f = fopen("audio.cfg", "w"); + FILE* f; + fopen_s(&f, "audio.cfg", "w"); if (f) { fprintf(f, "AUDIO\n\n"); fprintf(f, "menu_music: %3d\n", menu_music); -- cgit v1.1