Skip to content
Permalink
Browse files
Added error checking when opening a screenshot file
  • Loading branch information
ata4 committed Aug 27, 2017
1 parent cf14c95 commit 24adcb5e15f040332a34b2648c088b484f049d0a
Showing with 5 additions and 0 deletions.
  1. +5 −0 core/vi.c
@@ -120,6 +120,11 @@ static void vi_screenshot_write(char* path, int32_t* buffer, int width, int heig

FILE* fp = fopen(path, "wb");

if (!fp) {
msg_warning("Can't open screenshot file %s!", path);
return;
}

// write bitmap headers
fwrite(&fhdr, sizeof(fhdr), 1, fp);
fwrite(&ihdr, sizeof(ihdr), 1, fp);

2 comments on commit 24adcb5

@ata4
Copy link
Owner Author

@ata4 ata4 commented on 24adcb5 Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're /u/OpenEmu on Reddit? Anyway, issues have been enabled now. 😃

@clobber
Copy link

@clobber clobber commented on 24adcb5 Aug 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're /u/OpenEmu on Reddit? Anyway, issues have been enabled now.

Nope, that's me :P

Please sign in to comment.