mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +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:
@@ -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