From: John Darrington Date: Thu, 2 Feb 2012 20:46:39 +0000 (+0100) Subject: Error with g_critical instead of g_assert on invalid variable types. X-Git-Tag: v0.7.9~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d9ee2dd5f5fbaeda0caf5a19ad4f018f4b22bc3;p=pspp-builds.git Error with g_critical instead of g_assert on invalid variable types. --- diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c index fb9fc6d9..ea3d2e09 100644 --- a/src/ui/gui/var-type-dialog.c +++ b/src/ui/gui/var-type-dialog.c @@ -807,14 +807,16 @@ on_var_type_ok_clicked (GtkWidget *w, gpointer data) break; case BUTTON_DATE: case BUTTON_CUSTOM: - g_assert (fmt_check_output (&dialog->fmt_l)); - result = memcpy (&spec, &dialog->fmt_l, sizeof (struct fmt_spec)); + if (! fmt_check_output (&dialog->fmt_l)) + g_critical ("Invalid variable format"); + else + result = memcpy (&spec, &dialog->fmt_l, sizeof (struct fmt_spec)); break; case BUTTON_DOLLAR: result = make_output_format_try (&spec, FMT_DOLLAR, width, decimals); break; default: - g_print ("Unknown variable type: %d\n", dialog->active_button) ; + g_critical ("Unknown variable type: %d", dialog->active_button) ; result = false; break; }