Check if file opening fails and don't write if it does

This commit is contained in:
jpaana 2004-06-11 09:10:08 +00:00
parent f5802b705a
commit a70e1bccb3

View file

@ -1237,6 +1237,12 @@ void SaveTGA (const char *filename, unsigned char *pixels, int width, int height
int i;
fout = fopen(filename, "wb");
if (!fout)
{
Con_Printf("Could not create file %s", filename);
return;
}
//fwrite(pixels, 1, width*height*4, fout);
for (i=0; i<width*height; i++) {
int ind = i*3;