From 939dab58d23272a68c16c625dbd14ff3f8f6c51b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 2 Dec 2025 22:12:26 -0500 Subject: sanity.c: fix read past the end of an array. --- src/sanity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sanity.c b/src/sanity.c index 5b5c787..df3cbe2 100644 --- a/src/sanity.c +++ b/src/sanity.c @@ -38,7 +38,7 @@ void sanity_check_filename(const char *fname) { bad_atari_filename(fname, "does not begin with A-Z"); } - for(i = 0; (c = fname[i]) && i < 12; i++) { + for(i = 0; (i < 12) && (c = fname[i]); i++) { if(c >= 'A' && c <= 'Z') continue; if(c >= '0' && c <= '9') -- cgit v1.2.3