ascii: Avoid buffer overread outputting page longer than allocated lines.
[pspp] / src / ui / gui / var-type-dialog.c
index 7f1d4aeccdc6e187332045965438a54f537f2170..514d983c3d719529f776c19d257212d2557dfa3f 100644 (file)
@@ -51,7 +51,9 @@ static const struct fmt_spec date_format[] =
     {FMT_WKYR, 10, 0},
     {FMT_WKYR, 8, 0},
     {FMT_DATETIME, 17, 0},
-    {FMT_DATETIME, 20, 0}
+    {FMT_DATETIME, 20, 0},
+    {FMT_YMDHMS, 16, 0},
+    {FMT_YMDHMS, 20, 0}
   };
 
 
@@ -201,7 +203,7 @@ psppire_var_type_dialog_new (const struct fmt_spec *format)
                   NULL));
 }
 
-void
+gint
 psppire_var_type_dialog_run (GtkWindow *parent_window,
                              struct fmt_spec *format)
 {
@@ -212,10 +214,13 @@ psppire_var_type_dialog_run (GtkWindow *parent_window,
   gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
   gtk_widget_show (GTK_WIDGET (dialog));
 
-  if (psppire_dialog_run (PSPPIRE_DIALOG (dialog)) == GTK_RESPONSE_OK)
+  gint result = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
+  if (result == GTK_RESPONSE_OK)
     *format = *psppire_var_type_dialog_get_format (dialog);
 
   gtk_widget_destroy (GTK_WIDGET (dialog));
+
+  return result;
 }
 
 
@@ -826,6 +831,8 @@ psppire_var_type_dialog_set_state (PsppireVarTypeDialog *dialog)
     case FMT_MOYR:
     case FMT_WKYR:
     case FMT_DATETIME:
+    case FMT_YMDHMS:
+    case FMT_MTIME:
     case FMT_TIME:
     case FMT_DTIME:
     case FMT_WKDAY: