From c198ca9808879cdf1cff1cec664137d937c0a3c0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 11 May 2009 06:33:15 -0700 Subject: [PATCH] gui: Fix segfault when pushing Del on a long string variable cell. Thanks to John Darrington for reporting the problem. --- src/ui/gui/psppire-data-store.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 8808fd32..9ce07ae2 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -653,12 +653,11 @@ psppire_data_store_clear_datum (PsppireSheetModel *model, PsppireDataStore *store = PSPPIRE_DATA_STORE (model); union value v; - int width; const struct variable *pv = psppire_dict_get_variable (store->dict, col); + int width = var_get_width (pv); const gint index = var_get_case_index (pv) ; - width = var_is_numeric (pv) ? 0 : MAX_SHORT_STRING; value_init (&v, width); value_set_missing (&v, width); psppire_data_store_set_value (store, row, index, &v); -- 2.30.2