These all look fine to me, except the last one: diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c index 04bd3e3..5c6cfeb 100644 --- a/src/ui/gui/psppire-dict.c +++ b/src/ui/gui/psppire-dict.c @@ -473,7 +473,7 @@ psppire_dict_get_variable (const PsppireDict *d, gint idx) g_return_val_if_fail (d, NULL); g_return_val_if_fail (d->dict, NULL);
- if ( dict_get_var_cnt (d->dict) <= idx ) + if ( idx < 0 || dict_get_var_cnt (d->dict) <= idx ) return NULL; I'm kinda interested to know why we're silently returning NULL anyway, and not using g_return_val_if_fail. Most probably this is/was a kludge to avoid some other problem. Perhaps it is no longer necessary. Anyway, I'd be interested to see what happens if we change it to use g_return_val_if_fail. J' On Sun, Apr 15, 2012 at 04:58:22PM -0700, Ben Pfaff wrote: Here's a first batch of changes that prepare for my work on the GUI data and variable sheets. Many of these changes simply fix minor bugs and style issues and do little improvements to infrastructure. Feedback welcomed. I'll give this a few days or until I hear back on reviews. Thanks, Ben. Ben Pfaff (11): psppire-data-editor: Drop psppire_data_editor_set_font() redundancy. psppire-data-store: Use PSPPIRE namespace instead of GTK+'s. psppire-data-store: Use NULL for a null pointer. psppire-buttonbox: Fix style in header file. gtkxpaned: Remove write-only variables. find-dialog: Change "Cancel" button to "Close" button. Allow dictionary 'var_deleted' callback to examine the deleted var. psppire-dict: Get rid of static var in auto_generate_var_name(). psppire-dict: Make auto_generate_var_name() public, and rename. psppire-dict: Return new var from psppire_dict_insert_variable(). psppire-dict: Better validate idx arg in psppire_dict_get_variable(). lib/gtk-contrib/gtkxpaned.c | 8 ---- src/data/dictionary.c | 6 +- src/data/dictionary.h | 3 +- src/ui/gui/find.ui | 2 +- src/ui/gui/marshaller-list | 2 +- src/ui/gui/psppire-buttonbox.c | 11 +++++- src/ui/gui/psppire-buttonbox.h | 9 ++-- src/ui/gui/psppire-data-editor.c | 12 +++--- src/ui/gui/psppire-data-store.c | 10 ++-- src/ui/gui/psppire-data-store.h | 22 +++++----- src/ui/gui/psppire-dict.c | 80 +++++++++++++++++++++++--------------- src/ui/gui/psppire-dict.h | 7 ++- src/ui/gui/psppire-var-store.c | 5 +- 13 files changed, 100 insertions(+), 77 deletions(-) -- 1.7.2.5 _______________________________________________ pspp-dev mailing list pspp-dev@gnu.org https://lists.gnu.org/mailman/listinfo/pspp-dev -- PGP Public key ID: 1024D/2DE827B3 fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3 See http://keys.gnupg.net or any PGP keyserver for public key.
signature.asc
Description: Digital signature
_______________________________________________ pspp-dev mailing list pspp-dev@gnu.org https://lists.gnu.org/mailman/listinfo/pspp-dev