shithub: rgbds

Download patch

ref: 75b9d4899061d4e329aab7cf5e5d37697d59fa81
parent: 3aabe9c79942736c1f7ebbfac3dee45927e39438
author: ISSOtm <eldredhabert0@gmail.com>
date: Sun Apr 24 09:17:03 EDT 2022

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.

--- a/test/gfx/randtilegen.c
+++ b/test/gfx/randtilegen.c
@@ -232,7 +232,7 @@
 			int len = sprintf(filename, "%s%" PRIu16 ".rng", argv[index], i);
 			rngRecorder = fopen(filename, "wb");
 			if (!rngRecorder) {
-				perror("RNG fopen");
+				perror(filename);
 				return 1;
 			}
 
@@ -239,7 +239,7 @@
 			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);