[File] [PATCH] MAME input recording: limit strings to maximum lengths

Mike Swanson mikeonthecomputer at gmail.com
Tue Sep 17 03:24:00 UTC 2024


Some driver names can fill up the full 12 bytes, and likewise MAME can
(especially from Git builds) fill up the entire 32 bytes of space in
the format header too.  Trying only to read until a null byte is not
smart :-)
---
 magic/Magdir/games | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/magic/Magdir/games b/magic/Magdir/games
index e32c5e6f..beff0e4a 100644
--- a/magic/Magdir/games
+++ b/magic/Magdir/games
@@ -143,8 +143,8 @@
 >8	leqdate	x			at %s,
 >16	leshort	x			format version %d.
 >18	leshort	x			\b%d,
->20	string	x			%s driver,
->32	string	x			%s
+>20	string/12	x			%s driver,
+>32	string/32	x			%s
 
 # doom - submitted by Jon Dowland
 
-- 
2.46.1



More information about the File mailing list