Check if file opening fails and don't write if it does
This commit is contained in:
parent
f5802b705a
commit
a70e1bccb3
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue