mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-04 03:05:36 +00:00
Make randtilegen report the file names it fails to open
Which of the two is erroring out can be inferred from the file name, anyway.
This commit is contained in:
1 parent
3aabe9c799
commit
75b9d48990
1 file changed
+2
-2
@@ -232,14 +232,14 @@ int main(int argc, char **argv) {
|
||||
int len = sprintf(filename, "%s%" PRIu16 ".rng", argv[index], i);
|
||||
rngRecorder = fopen(filename, "wb");
|
||||
if (!rngRecorder) {
|
||||
perror("RNG fopen");
|
||||
perror(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
filename[len - 3] = 'p'; // `.rng` -> `.png`
|
||||
FILE *img = fopen(filename, "wb");
|
||||
if (!img) {
|
||||
perror("PNG fopen");
|
||||
perror(filename);
|
||||
return 1;
|
||||
}
|
||||
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
|
||||
Reference in new issue
Block a user