From d489095bcdf9603053ebd514588093a991605ffb Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 15:37:22 +0000 Subject: More string and fopen safety measures --- nGenEx/Sound.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nGenEx/Sound.cpp') diff --git a/nGenEx/Sound.cpp b/nGenEx/Sound.cpp index b6ef695..b8e502a 100644 --- a/nGenEx/Sound.cpp +++ b/nGenEx/Sound.cpp @@ -59,7 +59,8 @@ Sound::CreateStream(const char* filename) LPBYTE p = 0; int len = 0; - FILE* f = ::fopen(filename, "rb"); + FILE* f; + ::fopen_s(&f, filename, "rb"); if (f) { fseek(f, 0, SEEK_END); @@ -157,7 +158,8 @@ Sound::CreateOggStream(const char* filename) WAVEFORMATEX wfex; ZeroMemory(&wfex, sizeof(wfex)); - FILE* f = ::fopen(filename, "rb"); + FILE* f; + ::fopen_s(&f, filename, "rb"); if (f) { OggVorbis_File* povf = new(__FILE__,__LINE__) OggVorbis_File; -- cgit v1.1