From 77573b33e98f4823a215a743f9ee426fde9cadc1 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 11 Dec 2022 22:36:39 +0100 Subject: [PATCH] Fix function Classify::WriteIntTemplates (issue #3965) It crashed when running mftraining because unicharset_size in file "inttemp" was written with 8 bytes instead of 4 bytes. Signed-off-by: Stefan Weil --- src/classify/intproto.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classify/intproto.cpp b/src/classify/intproto.cpp index e88e7959d0..b4a49c0056 100644 --- a/src/classify/intproto.cpp +++ b/src/classify/intproto.cpp @@ -919,13 +919,13 @@ void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView *window) { void Classify::WriteIntTemplates(FILE *File, INT_TEMPLATES_STRUCT *Templates, const UNICHARSET &target_unicharset) { INT_CLASS_STRUCT *Class; - auto unicharset_size = target_unicharset.size(); + uint32_t unicharset_size = target_unicharset.size(); int version_id = -5; // When negated by the reader -1 becomes +1 etc. if (Templates->NumClasses != unicharset_size) { tprintf( "Warning: executing WriteIntTemplates() with %d classes in" - " Templates, while target_unicharset size is %zu\n", + " Templates, while target_unicharset size is %" PRIu32 "\n", Templates->NumClasses, unicharset_size); }