X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-import-assistant.c;h=4de70352438dbb2bfc1b70add83ced17ad21fb2c;hb=7919fa5fc1f94ad0097507d20e2deea52ed06df8;hp=ed8df0c9bc25a1362fae6e576bd9fb416ab73c08;hpb=df3728b28df255a1bef368985a9185c221143168;p=pspp diff --git a/src/ui/gui/psppire-import-assistant.c b/src/ui/gui/psppire-import-assistant.c index ed8df0c9bc..4de7035243 100644 --- a/src/ui/gui/psppire-import-assistant.c +++ b/src/ui/gui/psppire-import-assistant.c @@ -301,7 +301,8 @@ choose_likely_separators (PsppireImportAssistant *ia) hmap_destroy (&count_map[j]); } - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget_assert (ia->builder, separators[most_frequent].name)), TRUE); + const char* sepname = separators[MAX (0,most_frequent)].name; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget_assert (ia->builder, sepname)), TRUE); } static void @@ -1241,7 +1242,7 @@ textfile_create_reader (PsppireImportAssistant *ia) int i; - struct fmt_guesser **fg = xcalloc (sizeof *fg, n_vars); + struct fmt_guesser **fg = XCALLOC (n_vars, struct fmt_guesser *); for (i = 0 ; i < n_vars; ++i) { fg[i] = fmt_guesser_create ();