From a32b9446ea1260d23f1415798eaaced92c399395 Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Thu, 21 Nov 2024 13:25:10 +0100 Subject: [PATCH] import assistant: fix variable width after guesser with output constraints The current code fixes the guessed variable width according to input constraints. But the data output stages checks the width against output constraints. The minimum width for FMT_E is 1 for input and 6 for output. When the guesser proposes FMT_E with width 5, then 5 is chosen. With this patch, the width is fixed to 6. Thanks to Fatemeh Ilkhani for reporting the bug and providing a csv that triggers the crash. Closes: https://savannah.gnu.org/bugs/?66456 --- src/ui/gui/psppire-import-textfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/gui/psppire-import-textfile.c b/src/ui/gui/psppire-import-textfile.c index 95251c7324..3257d439e1 100644 --- a/src/ui/gui/psppire-import-textfile.c +++ b/src/ui/gui/psppire-import-textfile.c @@ -697,7 +697,7 @@ textfile_create_reader (PsppireImportAssistant *ia) { struct fmt_spec fs = fmt_guesser_guess (fg[i]); - fmt_fix (&fs, FMT_FOR_INPUT); + fmt_fix (&fs, FMT_FOR_OUTPUT); struct variable *var = dict_get_var (ia->dict, i); -- 2.30.2