X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-store.c;h=4cdc295886009a7961b2832daf7f2d02ee12a338;hb=b64685d06f8db1aff292ec409abe25f8a483d775;hp=9abf8653594ac5b49f34bea03a9c8a19d06f9e9b;hpb=655bf3a3917cdf16f99fcbb680d2bf3159126a93;p=pspp-builds.git diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 9abf8653..4cdc2958 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -617,14 +617,21 @@ text_for_column(const struct PsppireVariable *pv, gint c, GError **err) } break; case COL_ALIGN: - return g_locale_to_utf8(gettext(alignments[psppire_variable_get_alignment(pv)]), - -1, -0, 0, err); + { + const gint align = psppire_variable_get_alignment(pv); + + g_assert(align < n_ALIGNMENTS); + return g_locale_to_utf8(gettext(alignments[align]),-1, -0, 0, err); + } break; case COL_MEASURE: - return g_locale_to_utf8(gettext(measures[psppire_variable_get_measure(pv)]), - -1, -0, 0, err); - break; + { + const gint measure = psppire_variable_get_measure(pv); + g_assert(measure < n_MEASURES); + return g_locale_to_utf8(gettext(measures[measure]), -1, -0, 0, err); + } + break; } return 0; }