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/Color.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nGenEx/Color.cpp') diff --git a/nGenEx/Color.cpp b/nGenEx/Color.cpp index 05f5fa2..55ea071 100644 --- a/nGenEx/Color.cpp +++ b/nGenEx/Color.cpp @@ -503,8 +503,9 @@ Color::SavePalette(const char* basename) { char filename[256]; - sprintf(filename, "%s.ipl", basename); - FILE* f = fopen(filename, "wb"); + sprintf_s(filename, "%s.ipl", basename); + FILE* f; + fopen_s(&f, filename, "wb"); if (f) { fwrite(table, sizeof(table), 1, f); fclose(f); @@ -599,7 +600,7 @@ Color::SaveShadeTable(const char* basename) return; char filename[256]; - sprintf(filename, "%s_clut.pcx", basename); + sprintf_s(filename, "%s_clut.pcx", basename); BYTE clut[256*256]; BYTE* pc = clut; -- cgit v1.1