Prevent widths less than 1
[pspp-builds.git] / src / ui / gui / psppire-data-editor.c
index 52f7ddfd579e52cc27456852ef67a75fcd9a6648..0fe4f68091b1d8395d8d7c8e0e1c437b56035e63 100644 (file)
@@ -347,8 +347,13 @@ rewidth_variable_callback (PsppireDict *dict, gint posn, gpointer data)
 
   const struct variable *var = psppire_dict_get_variable (dict, posn);
 
-  psppire_axis_impl_resize (de->haxis, posn, m_width *
-                           var_get_display_width (var));
+  gint var_width = var_get_display_width (var);
+
+  /* Don't allow zero width */
+  if ( var_width < 1 )
+    var_width = 1;
+
+  psppire_axis_impl_resize (de->haxis, posn, m_width * var_width);
 }